]> git.notmuchmail.org Git - notmuch/commitdiff
tests: remove entangling corpus index optimization
authorJameson Graef Rollins <jrollins@finestructure.net>
Sat, 4 May 2019 20:57:43 +0000 (20:57 +0000)
committerDavid Bremner <david@tethera.net>
Tue, 7 May 2019 09:53:57 +0000 (06:53 -0300)
The add_email_corpus test utility includes logic that tries to re-use
an index of the corpus if available.  This was seemingly done as an
optimization, so that every test that uses the corpus didn't have to
create it's own index of the corpus.  However, this has the perverse
side effect of entangling tests together, and breaks parallelization.

Forcing each test to do it's own index does increase the overall time
of the test slightly (~6%), but this will be more than made up for in
the next patch that introduces paraellization.

test/.gitignore
test/Makefile.local
test/notmuch-test
test/test-lib.sh

index 69080e5e6123d75e3dec3d98e2d0d41c7f72b1a4..f5968404d86d97f316b6d24028e7b6fa5587861b 100644 (file)
@@ -1,5 +1,4 @@
 /arg-test
-/corpora.mail
 /hex-xcode
 /parse-time
 /random-corpus
index 1cf09778d5b5e44914a81dcdc06ff8799c9310c4..47244e8f0956977735b7ea0d4c1666211703ad1a 100644 (file)
@@ -81,4 +81,4 @@ check: test
 SRCS := $(SRCS) $(test_srcs)
 CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
         $(dir)/database-test.o \
-        $(dir)/corpora.mail $(dir)/test-results $(dir)/tmp.*
+        $(dir)/test-results $(dir)/tmp.*
index ca68dd416cfc17ab5132538b8fe36db37a6cbc5a..1a1ae811cada6264ba644d3a5c4c7f258ef3418d 100755 (executable)
@@ -59,6 +59,6 @@ $NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/*
 ev=$?
 
 # Clean up
-rm -rf $NOTMUCH_BUILDDIR/test/test-results $NOTMUCH_BUILDDIR/test/corpora.mail
+rm -rf $NOTMUCH_BUILDDIR/test/test-results
 
 exit $ev
index 54247a57c154ab234fd5779aedf40b0da823cbdd..f5d367aae2d71c161bd45a707b851b7c1a275221 100644 (file)
@@ -396,14 +396,8 @@ add_email_corpus ()
     corpus=${1:-default}
 
     rm -rf ${MAIL_DIR}
-    if [ -d $TEST_DIRECTORY/corpora.mail/$corpus ]; then
-       cp -a $TEST_DIRECTORY/corpora.mail/$corpus ${MAIL_DIR}
-    else
-       cp -a $NOTMUCH_SRCDIR/test/corpora/$corpus ${MAIL_DIR}
-       notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus"
-       mkdir -p $TEST_DIRECTORY/corpora.mail
-       cp -a ${MAIL_DIR} $TEST_DIRECTORY/corpora.mail/$corpus
-    fi
+    cp -a $NOTMUCH_SRCDIR/test/corpora/$corpus ${MAIL_DIR}
+    notmuch new >/dev/null || die "'notmuch new' failed while adding email corpus"
 }
 
 test_begin_subtest ()