From: David Bremner Date: Sat, 8 Mar 2014 21:19:45 +0000 (+2000) Subject: [Patch v3 15/15] test: add machinery to download and verify databases X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c91ed13db1c4d35a12635ab8db0fb961b234bb98;p=notmuch-archives.git [Patch v3 15/15] test: add machinery to download and verify databases --- diff --git a/45/22d4951867182a5dc50da7b8d8a0314fab5528 b/45/22d4951867182a5dc50da7b8d8a0314fab5528 new file mode 100644 index 000000000..ef0c22a35 --- /dev/null +++ b/45/22d4951867182a5dc50da7b8d8a0314fab5528 @@ -0,0 +1,156 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1C7F6431FBD + for ; Sat, 8 Mar 2014 13:20:21 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id FBmf953zFurF for ; + Sat, 8 Mar 2014 13:20:14 -0800 (PST) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 78C3C431FBF + for ; Sat, 8 Mar 2014 13:20:13 -0800 (PST) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1WMOfF-000580-23; Sat, 08 Mar 2014 17:20:13 -0400 +Received: (nullmailer pid 28556 invoked by uid 1000); Sat, 08 Mar 2014 + 21:20:03 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v3 15/15] test: add machinery to download and verify databases +Date: Sat, 8 Mar 2014 17:19:45 -0400 +Message-Id: <1394313585-28422-16-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.8.5.3 +In-Reply-To: <1394313585-28422-1-git-send-email-david@tethera.net> +References: <1394313585-28422-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 08 Mar 2014 21:20:21 -0000 + +Note that it is intentional that the checksum file is not +downloaded. The intent is to check those into git. +--- + Makefile | 3 ++- + test/Makefile.local | 2 +- + test/README | 8 ++++++++ + test/T530-upgrade.sh | 2 +- + test/test-databases/Makefile | 7 +++++++ + test/test-databases/Makefile.local | 14 ++++++++++++++ + 6 files changed, 33 insertions(+), 3 deletions(-) + create mode 100644 test/test-databases/Makefile + create mode 100644 test/test-databases/Makefile.local + +diff --git a/Makefile b/Makefile +index 0428160..97084b1 100644 +--- a/Makefile ++++ b/Makefile +@@ -5,7 +5,8 @@ all: + # List all subdirectories here. Each contains its own Makefile.local. + # Use of '=', without '+=', seems to be required for out-of-tree + # builds to work. +-subdirs = compat completion emacs lib man parse-time-string performance-test util test ++subdirs = compat completion emacs lib man parse-time-string performance-test util test \ ++ test/test-databases + + # We make all targets depend on the Makefiles themselves. + global_deps = Makefile Makefile.config Makefile.local \ +diff --git a/test/Makefile.local b/test/Makefile.local +index 40aa7d8..bfabd15 100644 +--- a/test/Makefile.local ++++ b/test/Makefile.local +@@ -46,7 +46,7 @@ TEST_BINARIES=$(dir)/arg-test \ + + test-binaries: $(TEST_BINARIES) + +-test: all test-binaries ++test: all test-binaries fetch-test-databases + @${test_src_dir}/notmuch-test $(OPTIONS) + + check: test +diff --git a/test/README b/test/README +index 79a9b1b..81a1c82 100644 +--- a/test/README ++++ b/test/README +@@ -64,6 +64,14 @@ The following command-line options are available when running tests: + Pointing this argument at a tmpfs filesystem can improve the + speed of the test suite for some users. + ++Certain tests require precomputed databases to complete. You can fetch these ++databases with ++ ++ make download-test-databases ++ ++If you do not download the test databases, the relevant tests will be ++skipped. ++ + When invoking the test suite via "make test" any of the above options + can be specified as follows: + +diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh +index a3c2ed1..e1e8ac5 100755 +--- a/test/T530-upgrade.sh ++++ b/test/T530-upgrade.sh +@@ -7,7 +7,7 @@ dbtarball=folders-v1.tar.xz + + # XXX: Accomplish the same with test lib helpers + if [ ! -e ${TEST_DIRECTORY}/test-databases/${dbtarball} ]; then +- test_subtest_missing_external_prereq_["${dbtarball}"]=t ++ test_subtest_missing_external_prereq_["${dbtarball} - fetch with 'make download-test-databases'"]=t + fi + + test_expect_success \ +diff --git a/test/test-databases/Makefile b/test/test-databases/Makefile +new file mode 100644 +index 0000000..b250a8b +--- /dev/null ++++ b/test/test-databases/Makefile +@@ -0,0 +1,7 @@ ++# See Makefile.local for the list of files to be compiled in this ++# directory. ++all: ++ $(MAKE) -C ../.. all ++ ++.DEFAULT: ++ $(MAKE) -C ../.. $@ +diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local +new file mode 100644 +index 0000000..e777ada +--- /dev/null ++++ b/test/test-databases/Makefile.local +@@ -0,0 +1,14 @@ ++# -*- makefile -*- ++ ++TEST_DATABASE_MIRROR=http://notmuchmail.org/releases/test-databases ++ ++dir := test/test-databases ++ ++test_databases := $(dir)/folders-v1.tar.xz ++ ++%.tar.xz: ++ wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@); ++ ++download-test-databases: ${test_databases} ++ ++DISTCLEAN := $(DISTCLEAN) ${test_databases} +-- +1.8.5.3 +