test: test explicit configuration of backup directory Including the relative path that was broken until a recent commit.
CLI/new: use configuration variable for backup directory The stat is essentially replaced by the mkdir for error detection purposes. This changes the default location for backups to make things tidier, even in non-split configurations. Hopefully there is not too many user scripts relying on the previous location. Because the default location may not exist, replace the use of stat for error detection with a call to mkdir.
test: add (back) upgrade tests In ee897cab8b721 the upgrade tests from pre v3 databases were removed. The reasons for that are still valid, but we should still test the code paths that do the upgrade, and it is relatively straightforward to do that for v3 to v3 upgrades.
test: drop upgrade from v1 tests These are less crucial since we stopped generating new database versions and relied primarily on features. They also rely on a pre-generated v1 database which happens to be chert format. This backend is not supported by Xapian 1.5. Also drop the tool gen-testdb.sh, which is currently broken, due to changes in the testing infrastructure.
lib: add 'body:' field, stop indexing headers twice. The new `body:` field (in Xapian terms) or prefix (in slightly sloppier notmuch) terms allows matching terms that occur only in the body. Unprefixed query terms should continue to match anywhere (header or body) in the message. This follows a suggestion of Olly Betts to use the facility (since Xapian 1.0.4) to add the same field with multiple prefixes. The double indexing of previous versions is thus replaced with a query time expension of unprefixed query terms to the various prefixed equivalent. Reindexing will be needed for 'body:' searches to work correctly; otherwise they will also match messages where the term occur in headers (demonstrated by the new tests in T530-upgrade.sh)
test: use $(dirname "$0") for sourcing test-lib.sh Don't assume the tests are always run from within the source tree.
test: require test_begin_subtest before test_expect_success Unify the subtests by requiring test_begin_subtest before test_expect_success. (Similar change for test_expect_code will follow.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
complete ghost-on-removal-when-shared-thread-exists To fully complete the ghost-on-removal-when-shared-thread-exists proposal, we need to clear all ghost messages when the last active message is removed from a thread. Amended by db: Remove the last test of T530, as it no longer makes sense if we are garbage collecting ghost messages.
test: make script exit (1) if it "fails" to source (.) a file The files (test) scripts source (with builtin command `.`) provides information which the scripts depend, and without the `source` to succeed allowing script to continue may lead to dangerous situations (e.g. rm -rf "${undefined_variable}"/*). At the end of all source (.) lines construct ' || exit 1' was added; In our case the script script will exit if it cannot find (or read) the file to be sourced. Additionally script would also exits if the last command of the sourced file exited nonzero.
test: Test upgrade to ghost messages feature
new: Don't report version after upgrade The version number has always been pretty meaningless to the user and it's about to become even more meaningless with the introduction of "features". Hopefully, the database will remain on version 3 for some time to come; however, the introduction of new features over time in version 3 will necessitate upgrades within version 3. It would be confusing if we always tell the user they've been "upgraded to version 3". If the user wants to know what's new, they should read the news.
test: verify tag backup generated by database upgrade 'pre upgrade dump' is not much of a test, but at least this way we get somewhat sensible behaviour if it fails.
notmuch-new: backup tags before database upgrade All we do here is calculate the backup filename, and call the existing dump routine. Also take the opportunity to add a message about being safe to interrupt.
test: add machinery to download and verify databases Note that it is intentional that the checksum file is not downloaded. The intent is to check those into git.
test: add database upgrade test from format version 1 to 2 Test the upgrade from probabilistic to boolean folder: terms, and addition of path: terms. The test depends on the pre-built test corpus and database tarball and checksum file being in place. If it's not, the test is skipped. The mechanism to fetch the test database will be added later. At the time of writing, a working test database and checksum file is available at http://notmuchmail.org/releases/test-databases/ It has been noted that some non-GNU environments make lack sha256sum. We leave this portability issue for a followup patch.