[PATCH v4 13/13] test: add machinery to download and verify databases
authorJani Nikula <jani@nikula.org>
Sun, 9 Mar 2014 21:40:34 +0000 (23:40 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:33 +0000 (10:00 -0800)
45/0ec6327356655adae376a8204045056e2e1495 [new file with mode: 0644]

diff --git a/45/0ec6327356655adae376a8204045056e2e1495 b/45/0ec6327356655adae376a8204045056e2e1495
new file mode 100644 (file)
index 0000000..e1ef077
--- /dev/null
@@ -0,0 +1,166 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2D474429E44\r
+       for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:42:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id gOHPC20IYG-6 for <notmuch@notmuchmail.org>;\r
+       Sun,  9 Mar 2014 14:42:03 -0700 (PDT)\r
+Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com\r
+       [209.85.217.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D5F40431FCB\r
+       for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:41:10 -0700 (PDT)\r
+Received: by mail-lb0-f180.google.com with SMTP id 10so4175926lbg.11\r
+       for <notmuch@notmuchmail.org>; Sun, 09 Mar 2014 14:41:09 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references:in-reply-to:references;\r
+       bh=FjdV0juwo85rcb/rHUr7qHjM17I1NwQS937yZmpinFI=;\r
+       b=lxw0kxvUdlXvhHhjEb9/fyeQcWxWqDbtImaDH5izry4yCz3NeCp1IM6jOT2dzj+b/n\r
+       1xaww/ZEUs9bIMgAsVER2MQyZPRP9IlwsvIFHwiia6U/IckNAgWsDgma/AbHX3EQ6fLj\r
+       nMo90OAPQU1LlYmG/+QQxoRh7R5PB3v09ZoRDJkmnsiGTScZh/8sKT5b54cYi4dVZn2H\r
+       7OCj1MCuCks+Gbl3FKwRIpesZk0toqEJJhIY8g0v7rx0M/jPvgXdUNTZLJTIuY8/63an\r
+       G+vuXWG8XBlDjwoILGzoNFbDuzeVgf1ByQ3NaLQXGTA0cepQ7Egdh6GzBwNqBxod08RO\r
+       gDvA==\r
+X-Gm-Message-State:\r
+ ALoCoQnT1y4kZ5bZ3+GBV9QzE5vEEEv580IoYKx1UKiFgDJykUWyznR91EA1yW2zEpv7wjGjC+sG\r
+X-Received: by 10.152.18.229 with SMTP id z5mr21155475lad.27.1394401269412;\r
+       Sun, 09 Mar 2014 14:41:09 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id v5sm26918875laj.0.2014.03.09.14.41.08\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 09 Mar 2014 14:41:08 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 13/13] test: add machinery to download and verify databases\r
+Date: Sun,  9 Mar 2014 23:40:34 +0200\r
+Message-Id:\r
+ <aa1f5c1f9a06736c01065b01525625408cc2adbf.1394400503.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
+References: <cover.1394400503.git.jani@nikula.org>\r
+In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
+References: <cover.1394400503.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 09 Mar 2014 21:42:08 -0000\r
+\r
+From: David Bremner <david@tethera.net>\r
+\r
+Note that it is intentional that the checksum file is not\r
+downloaded. The intent is to check those into git.\r
+---\r
+ Makefile                           |  3 ++-\r
+ test/README                        |  8 ++++++++\r
+ test/T530-upgrade.sh               |  2 +-\r
+ test/test-databases/Makefile       |  7 +++++++\r
+ test/test-databases/Makefile.local | 14 ++++++++++++++\r
+ 5 files changed, 32 insertions(+), 2 deletions(-)\r
+ create mode 100644 test/test-databases/Makefile\r
+ create mode 100644 test/test-databases/Makefile.local\r
+\r
+diff --git a/Makefile b/Makefile\r
+index 0428160b80c2..97084b1c1cd0 100644\r
+--- a/Makefile\r
++++ b/Makefile\r
+@@ -5,7 +5,8 @@ all:\r
+ # List all subdirectories here. Each contains its own Makefile.local.\r
+ # Use of '=', without '+=', seems to be required for out-of-tree\r
+ # builds to work.\r
+-subdirs = compat completion emacs lib man parse-time-string performance-test util test\r
++subdirs = compat completion emacs lib man parse-time-string performance-test util test \\r
++      test/test-databases\r
\r
+ # We make all targets depend on the Makefiles themselves.\r
+ global_deps = Makefile Makefile.config Makefile.local \\r
+diff --git a/test/README b/test/README\r
+index 79a9b1b2f9a1..81a1c82dcdbd 100644\r
+--- a/test/README\r
++++ b/test/README\r
+@@ -64,6 +64,14 @@ The following command-line options are available when running tests:\r
+       Pointing this argument at a tmpfs filesystem can improve the\r
+       speed of the test suite for some users.\r
\r
++Certain tests require precomputed databases to complete. You can fetch these\r
++databases with\r
++\r
++      make download-test-databases\r
++\r
++If you do not download the test databases, the relevant tests will be\r
++skipped.\r
++\r
+ When invoking the test suite via "make test" any of the above options\r
+ can be specified as follows:\r
\r
+diff --git a/test/T530-upgrade.sh b/test/T530-upgrade.sh\r
+index 1d883986db83..6cbbb860998a 100755\r
+--- a/test/T530-upgrade.sh\r
++++ b/test/T530-upgrade.sh\r
+@@ -7,7 +7,7 @@ dbtarball=folders-v1.tar.xz\r
\r
+ # XXX: Accomplish the same with test lib helpers\r
+ if [ ! -e ${TEST_DIRECTORY}/test-databases/${dbtarball} ]; then\r
+-    test_subtest_missing_external_prereq_["${dbtarball}"]=t\r
++    test_subtest_missing_external_prereq_["${dbtarball} - fetch with 'make download-test-databases'"]=t\r
+ fi\r
\r
+ test_expect_success \\r
+diff --git a/test/test-databases/Makefile b/test/test-databases/Makefile\r
+new file mode 100644\r
+index 000000000000..b250a8bea31d\r
+--- /dev/null\r
++++ b/test/test-databases/Makefile\r
+@@ -0,0 +1,7 @@\r
++# See Makefile.local for the list of files to be compiled in this\r
++# directory.\r
++all:\r
++      $(MAKE) -C ../.. all\r
++\r
++.DEFAULT:\r
++      $(MAKE) -C ../.. $@\r
+diff --git a/test/test-databases/Makefile.local b/test/test-databases/Makefile.local\r
+new file mode 100644\r
+index 000000000000..e777ada71667\r
+--- /dev/null\r
++++ b/test/test-databases/Makefile.local\r
+@@ -0,0 +1,14 @@\r
++# -*- makefile -*-\r
++\r
++TEST_DATABASE_MIRROR=http://notmuchmail.org/releases/test-databases\r
++\r
++dir := test/test-databases\r
++\r
++test_databases := $(dir)/folders-v1.tar.xz\r
++\r
++%.tar.xz:\r
++      wget -nv -O $@ ${TEST_DATABASE_MIRROR}/$(notdir $@);\r
++\r
++download-test-databases: ${test_databases}\r
++\r
++DISTCLEAN := $(DISTCLEAN) ${test_databases}\r
+-- \r
+1.9.0\r
+\r