summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-08-22CLI: define and use format version 5David Bremner
This is a bit of a cheat, since the format does not actually change. On the other hand it is fairly common to do something like this to shared libary SONAMEs when the ABI changes in some subtle way. It does rely on the format-version argument being early enough on the command line to generate a sensible error message.
2021-08-21test/path-config: use test_expect_equal_file_nonemptyDavid Bremner
This is more robust against crashes when the expected output is also generated by notmuch. In the case where the expected output is explicit, it seems like overkill.
2021-08-21test: add test_expect_equal_file_nonemptyDavid Bremner
A common bug in tests is that the code used to generate the EXPECTED file fails, generating no output. When the code generating the OUTPUT file fails in the same way, the test passes, even though there is a failure being hidden. Add a new test function that guards against this.
2021-08-21test: factor out test_diff_file_David Bremner
A following commit will use this new function in a public test function.
2021-08-21test/expect_equal_file: whitespace cleanupDavid Bremner
No functional change, just reindent to Emacs defaults.
2021-08-18Merge tag 'debian/0.32.3-1'David Bremner
notmuch release 0.32.3-1 for unstable (sid) [dgit] [dgit distro=debian no-split --quilt=linear]
2021-08-17CLI/config: restore "notmuch config get built_with.*"David Bremner
We need to special case the config section "built_with" because it is not (currently) handled by the library. This seems consist with the other sub-sub-commands 'list' and 'set'.
2021-08-17test/config: add tests for built_withDavid Bremner
The "get" test is known broken because this functionality was dropped during the 0.32 config rewrite.
2021-08-17lib/open: look in MAILDIR for database, as documented.David Bremner
This fixes the bug id:87bl9lx864.fsf@kisara.moe
2021-08-17test: add known broken tests for finding database via MAILDIRDavid Bremner
This highlights a bug reported by several users, including Mohsin Kaleem [1]. The inconsistent use of test_begin_subtest_known_broken is because some of these tests pass even though the database cannot be located. This problem is left for a future commit. [1]: id:87bl9lx864.fsf@kisara.moe
2021-08-03test: revert to mkdir -p to make results directory.David Bremner
As suggested by id:m21r7al3mt.fsf@guru.guru-group.fi
2021-08-03test: use --minversion to detect GNU Parallel.David Bremner
Based on a suggestion of Ole Tange [1]. [1]: id:CA+4vN7x6jp4HCiEybZ=5g+2X6Pa7etBFX3Bbd=UYty37gR6wEQ@mail.gmail.com
2021-07-03CLI/show: tests for the new --sort optionjao
New unit tests for notmuch show --sort, covering the basic use cases.
2021-06-29test: deduplicate T590Michael J Gruber
Test numbers are a concise way to communicate about tests and to remeber them. Currently, there is one pait of duplicates: T590-libconfig.sh T590-thread-breakage.sh Renumber the latter one to 592 since this keeps the alphabetic order and leaves room in between. Signed-off-by: Michael J Gruber <git@grubix.eu>
2021-06-27emacs/tree use notmuch-show-single-messageDavid Bremner
This is more efficient than notmuch-show-only-matching-messages, since we do not parse the potentially large thread structure to find a single message. This is only a partial fix for notmuch-tree view, because displaying the thread structure in the tree-mode window still crashes on long threads. It is however enough to make unthreaded view handle long threads.
2021-06-27test: start test file for emacs unthreaded view.David Bremner
Initial focus is on behaviour with large threads. The second test replicates a bug reported by Alan Schmitt in id:87lf7sojbq.fsf@m4x.org.
2021-06-27ruby: add keyword arguments to db.queryFelipe Contreras
That way we don't need pass them to the query object ourselves. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-06-27lib: autocommit after some number of completed transactionsDavid Bremner
This change addresses two known issues with large sets of changes to the database. The first is that as reported by Steven Allen [1], notmuch commits are not "flushed" when they complete, which means that if there is an open transaction when the database closes (or e.g. the program crashes) then all changes since the last commit will be discarded (nothing is irrecoverably lost for "notmuch new", as the indexing process just restarts next time it is run). This does not really "fix" the issue reported in [1]; that seems rather difficult given how transactions work in Xapian. On the other hand, with the default settings, this should mean one only loses less than a minutes worth of work. The second issue is the occasionally reported "storm" of disk writes when notmuch finishes. I don't yet have a test for this, but I think committing as we go should reduce the amount of work when finalizing the database. [1]: id:20151025210215.GA3754@stebalien.com
2021-06-27test: add known broken test for closing with open transactionDavid Bremner
The expected output may need adjusting, but what is clear is that saving none of the changes is not desirable.
2021-06-27lib/config: add NOTMUCH_CONFIG_AUTOCOMMITDavid Bremner
This will be used to control how often atomic transactions are committed.
2021-06-26cli/show: produce "email" element in sigstatusDaniel Kahn Gillmor
When the certificate that signs a message is known to be valid, GMime is capable of reporting on the e-mail address embedded in the certificate. We pass this information along to the caller of "notmuch show", as often only the e-mail address of the certificate has actually been checked/verified. Furthermore, signature verification should probably at some point compare the e-mail address of the caller against the sender address of the message itself. Having to parse what gmime thinks is a "userid" to extract an e-mail address seems clunky and unnecessary if gmime already thinks it knows what the e-mail address is. See id:878s41ax6t.fsf@fifthhorseman.net for more motivation and discussion. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2021-06-21test/libconfig: make indexing more consistentDavid Bremner
The other tests have converted to two digit decimal, the commit does the same to the remaining test that was printing out indices in hex.
2021-06-20Merge branch 'release'David Bremner
2021-06-08test: check openssl prequisite for add_gpgsm_homeDavid Bremner
This is a fix for the test failures reported by Dan Čermák [1]. It is more robust to check for the prerequisite inside the function that uses it, rather than in every test file that calls the function. [1]: id:87k0n4fqgm.fsf@tethera.net
2021-06-07test: aggregate-results updatesTomi Ollila
notmuch-test will now call aggregate-results.sh with file list that it compiles based on the test ran, and aggregate-results will report failure is any of the test files are missing. With this notmuch-test no longer has to exit in non-parallel run if some test fail to write its report file -- so it works as parallel tests in this sense. Changed test_done() in test-lib.sh write report file in one write(2), so there is (even) less chance it being partially written. Also, now it writes 'total' last and aggregate-results.sh expects this line to exist in all report files for reporting to be successful. Added 'set -eu' to notmuch-test and modified code to work with these settings. That makes it harder to get mistakes slipped into committed code.
2021-06-05emacs: update default mailing list archives for stashing linksJani Nikula
Gmane web interface is long gone, remove it. Make MARC the new default. Update LKML to Lore, where it already redirects anyway. Also add Notmuch web archive.
2021-06-05test: add known broken test for indexing RFC822 group namesDavid Bremner
Austin Clements diagnosed this indexing problem in [1]. [1]: id:20130711215207.GR2214@mit.edu
2021-06-03test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.shTomi Ollila
Sourcing test-lib.sh will cd to TMP_DIRECTORY, so relative path in $0 will not work in previous version . $(dirname "$0")/test-lib-emacs.sh Now individual test scripts -- e.g. ./test/T310-emacs.sh will work.
2021-05-23ruby: use notmuch_exclude_t enumFelipe Contreras
It exists since 2013, let's allow it to be used in Ruby. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-23test: add regression test for large number of deletionsDavid Bremner
Prior to 9ad19e4454f there was an unhandled Xapian exception when reindexing after a large number of deletes. This test was used for bisection, and will subsequently serve as a regression test.
2021-05-23test: say_color() in one write(2)Tomi Ollila
say_color() used to call (builtin) printf (and tput(1) to stdout) several times, which caused attempts to write messages with color to have partial content (e.g. escape sequences) often intermixed with other tests when parallel tests were run. Now, with all output collected, then written out using one printf, all strings with color print out correctly ((at least short) write(2)'s appear to write out "atomically"). While at it, used only one tput(1) execution to determine whether color output works, and made bold/colors/sgr0 to tput(1) their values once per test.
2021-05-23test: quiet some extra debugging outputDavid Bremner
This output does not cause test failures, but may make it harder to interpret the output.
2021-05-23test: ignore debugging messagesDavid Bremner
Previously building with "-DDEBUG" broke the test suite in several places.
2021-05-22test: replace notmuch_passwd_sanitize() with _libconfig_sanitize()Tomi Ollila
notmuch_passwd_sanitize() in test-lib.sh is too generic, it cannot work in many cases... The more specific version _libconfig_sanitize() replaces it in T590-libconfig.sh and the code that uses it is modified to output the keys (ascending numbers printed in hex) so the sanitizer knows what to sanitize in which lines... "@" + fqdn -> "@FQDN" replacement is used as fqdn could -- in theory -- be substring of 'USERNAME'. 'user -> 'USER_FULL_NAME replacement to work in cases where user is empty -- as only first ' is replaced that works as expected. In addition to ".(none)" now also ".localdomain" is filtered from USERNAME@FQDN. /dev/fd/{n} is not defined in posix, but it is portable enough (if it weren't it is easy to fix -- now code looks clearer).
2021-05-22Merge branch 'release'David Bremner
2021-05-22lib/n_d_index_file: re-use thread-id of existing messageDavid Bremner
This prevents the message document getting multiple thread-id terms when there are multiple files with the same message-id. This change shifts some thread ids, requiring adjustments to other tests.
2021-05-22test: add known broken test for duplicate thread-id termsDavid Bremner
According to my bijection, this bug has been present since commit 411675a6ce in 2017. It is not completely clear what harm it causes in regulary use, but it (at least) makes notmuch crash when compiled with -DDEBUG_DATABASE_SANITY.
2021-05-17test: split emacs functionality to its own fileFelipe Contreras
This way it's easier to identify the tests that do require emacs stuff. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: fix a couple of shellcheck complaintsFelipe Contreras
In test-lib-emacs.sh line 20: test_require_external_prereq ${TEST_EMACS} || ret=1 ^-----------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACS}" || ret=1 In test-lib-emacs.sh line 21: test_require_external_prereq ${TEST_EMACSCLIENT} || ret=1 ^-----------------^ SC2086: Double quote to prevent globbing and word splitting. Did you mean: test_require_external_prereq "${TEST_EMACSCLIENT}" || ret=1 Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: check for configured emacsFelipe Contreras
Commit d59d9c81 (test: Make the emacsclient binary user-configurable, 2012-11-27) modified the prereq check for the configured emacsclient, but we probably want to do the same for emacs itself. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: emacs: simplify missing dependencies checkFelipe Contreras
No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: more style fixesFelipe Contreras
In order to fit the git coding style. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-17test: trivial style cleanupsFelipe Contreras
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-05-15Merge branch 'release'David Bremner
2021-05-15lib/open: restore default database path of $HOME/mailDavid Bremner
Although this default worked for "notmuch config get", it didn't work most other places. Restore the previous functionality, with the wrinkle that XDG locations will shadow $HOME/mail if they exist. This fixes a bug reported by Jack Kamm in id:87eeefdc8b.fsf@gmail.com
2021-05-15emacs: restore tag-changes and query bindings for tag hooksKyle Meyer
notmuch-before-tag-hook and notmuch-after-tag-hook are supposed to have access to two dynamic variables, tag-changes and query, but these were lost with the switch to lexical binding in fc4cda07 (emacs: use lexical-bindings in all libraries, 2021-01-13). Add a variant of Emacs's dlet (not available until Emacs 28) and use it in notmuch-tag to expose tag-changes and query to the hooks.
2021-05-15test: add known broken tests for notuch-{before,after}-tag-hookDavid Bremner
These tests illustrate the bug reported in id:87v97ytd2s.fsf@fastmail.fm
2021-05-12Merge branch 'release'David Bremner
2021-05-12lib/notmuch_database_reopen: reload some database metadataDavid Bremner
In some uses of reopen, new documents and threads maybe have been added, and e.g. compaction may have changed the uuid.
2021-05-12test: change database from within pre-new hookMichael J Gruber
Due to the change in the config system, notmuch keeps a notmuch database open when it would not do so before. Consequently, it can miss changes to the database which are done from a hook (while notmuch holds the databse in read only mode). When notmuch itself writes to the database after that it uses wrong assumptions about the last used doc id etc. Demonstrate this by triggering an assertion. (This new test succeeds with notmuch 0.31.4.) Signed-off-by: Michael J Gruber <git@grubix.eu> Amended-by: db. Check for both messages