aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-09-04lib/parse-sexp: handle saved queriesDavid Bremner
This provides functionality analogous to query: in the Xapian QueryParser based parser. Perhaps counterintuitively, the saved queries currently have to be in the original query syntax (i.e. not s-expressions).
2021-09-04lib/parse-sexp: parse user headersDavid Bremner
One subtle aspect is the replacement of _find_prefix with _notmuch_database_prefix, which understands user headers. Otherwise the code mainly consists of creating a fake prefix record (since the user prefixes are not in the prefix table) and error handling.
2021-09-04lib/parse-sexp: support infix subqueriesDavid Bremner
This is necessary so that programs can take infix syntax queries from a user and use the sexp query syntax to construct e.g. a refinement of that query.
2021-09-04lib/parse-sexp: expand queriesDavid Bremner
The code here is just gluing together _notmuch_query_expand with the existing sexp parser infrastructure.
2021-09-04lib/parse-sexp: support regular expressionsDavid Bremner
At least to the degree that the Xapian QueryParser based parser also supports them. Support short alias 'rx' as it seems to make more complex queries nicer to read.
2021-09-04lib/query: generalize exclude handling to s-expression queriesDavid Bremner
In fact most of the code path is in common, only the caching of terms in the query needs to be added for s-expression queries.
2021-09-04lib/parse-sexp: handle unprefixed terms.David Bremner
This is equivalent to adding the same field name "" for multiple prefixes in the Xapian query parser, but we have to explicitely construct the resulting query.
2021-09-04lib/parse-sexp: add '*' as syntactic sugar for '(starts-with "")'David Bremner
Users that insist on using a literal '*' as a tag, can continue to do so by quoting it when searching.
2021-09-04lib/parse-sexp: 'starts-with' wildcard searchesDavid Bremner
The many tests potentially overkill, but they could catch typos in the prefixes table. As a simplifying assumption, for now we assume a single argument to the wildcard operator, as this matches the Xapian semantics. The name 'starts-with' is chosen to emphasize the supported case of wildcards in currrent (1.4.x) Xapian.
2021-09-04lib/parse-sexp: add term prefix backed fieldsDavid Bremner
We use "boolean" to describe fields that should generate terms literally without stemming or phrase splitting. This terminology might not be ideal but it is already enshrined in notmuch-search-terms(7).
2021-09-04lib/parse-sexp: support phrase queries.David Bremner
Anything that is quoted or not purely word characters is considered a phrase. Phrases are not stemmed, because the stems do not have positional information in the database. It is less efficient to scan the term twice, but it avoids a second pass to add prefixes, so maybe it balances out. In any case, it seems unlikely query parsing is very often a bottleneck.
2021-09-04lib/parse-sexp: support subject fieldDavid Bremner
The broken tests are because we do not yet handle phrase searches.
2021-09-04lib/parse-sexp: support and, not, and or.David Bremner
All operations and (Xapian) fields will eventually have an entry in the prefixes table. The flags field is just a placeholder for now, but will eventually distinguish between various kinds of prefixes.
2021-09-04lib/parse-sexp: stem unquoted atomsDavid Bremner
This is somewhat less DWIM than the Xapian query parser, but it has the advantage of simplicity.
2021-09-04lib/parse-sexp: parse single terms and the empty list.David Bremner
There is not much of a parser here yet, but it already does some useful error reporting. Most functionality sketched in the documentation is not implemented yet; detailed documentation will follow with the implementation.
2021-09-04CLI/search+address: support sexpr queriesDavid Bremner
Initially support selection of query syntax in two subcommands to enable testing.
2021-09-04configure: optional library sfsexpDavid Bremner
The configure part is essentially the same as the other checks using pkg-config. Since the optional inclusion of this feature changes what options are available to the user, include it in the "built_with" pseudo-configuration keys.
2021-09-04CLI: make variable n_requested_db_uuid file scope.David Bremner
It turns out that now that we pass an open database into the subcommands, it is easy to check any requested uuid against the database at the same time as we process the other shared arguments. This results in overall less boilerplate code, as well as making a CLI scope function and variable file scope in notmuch.c.
2021-08-30test: known broken test for emacs display of message/rfc822 partsDavid Bremner
There are at least 3 bugs present. 1) notmuch-show-insert-part-message/rfc822 assumes that message/rfc822 parts will have a ":content" property, but that turns out not to be the case. 2) something deep in gnus wants gnus-newsgroup-charset, but that is defined in gnus-sum, which is not loaded by default. 3) If gnus-sum is loaded, then the display of the message/rfc822 part succeeds, but the buffer gets put into gnus-article-mode, which means that, inter alia, notmuch text properties and keybindings get wiped.
2021-08-30test/crypto: test message with rfc822 attachment.David Bremner
This is intended to help track down a display problem in the emacs front end
2021-08-29lib: consider all instances of Delivered-To headerHannu Hartikainen
When using notmuch-reply and guessing the From: address from Delivered-To headers, I had the wrong address chosen today. This was because the messages from the notmuch list contain these headers in this order: Delivered-To: hannu.hartikainen@gmail.com ... Delivered-To: hannu@hrtk.in In my .notmuch-config I have the following configuration: primary_email=hannu@hrtk.in other_email=hannu.hartikainen@gmail.com;... Before this change, notmuch-reply would guess From: @gmail.com because that is the first Delivered-To header present. After the change, the primary address is chosen as I would expect.
2021-08-29reply: add test for multiple Delivered-To headersHannu Hartikainen
Add a known broken subtest for guessing From: correctly when there are multiple Delivered-To: headers. The address configured as primary_email should get picked.
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.