summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2026-01-16test/cli: Add reproducer for the spurious warning about uuid.David Bremner
As reported by "lh" on IRC.
2026-01-15emacs/hello: fix one case of passing hide-excludedDavid Bremner
In the search box (and recent searches), notmuch-search-hide-excluded was not being passed to notmuch-search. This means that excluded messages were always shown in the results. Fix this by passing the extra argument.
2026-01-15test/emacs: known broken test for excludes and notmuch-helloDavid Bremner
One of the places notmuch-search is called did not get the new 'hide-excluded' argument.
2026-01-15One of the places notmuch-search is called did not get the newDavid Bremner
'hide-excluded' argument.
2025-08-04lib: add notmuch_threads_status()Anton Khirnov
While a number of errors can happen when iterating over threads (DatabaseModifiedError, memory allocation errors, etc.), the API currently cannot signal them to the caller, and either triggers an internal error (aborting the caller) or returns NULL from notmuch_threads_get() with no information on what actually went wrong. Add a new public function notmuch_threads_status() - similar to previously added notmuch_messages_status() - that allows propagating those errors to the caller. Use this to remove the INTERNAL_ERROR() in _notmuch_thread_create() (triggered by T642). Fixes: https://github.com/pazz/alot/issues/1460 Amended-By: db. Resolved whitespace disagreement between emacs and uncrustify in favour of uncrustify.
2025-08-04test: add a known broken test for DatabaseModifiedError from threads iterationAnton Khirnov
This is similar to previously added T641, except here we iterate over threads rather than messages. After f375ea1add121c428f261473512831a169dfe335, the DatabaseModifiedError raised by Xapian is now handled in _notmuch_message_create(), resulting in a NULL message being returned to _notmuch_thread_create(), which currently triggers an internal error.
2025-07-24lib: handle DatabaseModifiedError in _notmuch_message_createAnton Khirnov
If an open database is modified sufficiently by other callers, the open instance becomes invalid and operations on it throw DatabaseModifiedError. Per Xapian documentation, the caller is then supposed to reopen the database and restart the query. This exception is currently not handled in _notmuch_message_create(), leading to the default handler abort()ing the process. Catch this exception in _notmuch_message_create() and return an error instead of crashing. Since the entire query becomes invalid - including results that have already been read by the caller - this situation cannot be handled by libnotmuch transparently. A new public function - notmuch_messages_status() - is added to allow the callers to check whether the messages iterator was exhausted or terminated early due to a runtime error. This also allows memory allocation failure to be signalled to the caller. Amended-By: David Bremner <david@tethera.net> [replace use of notmuch_messages_valid]
2025-07-06test: add another known broken test for uncaught DatabaseModifiedErrorAnton Khirnov
This one is raised from _notmuch_message_create(). See also https://github.com/pazz/alot/issues/1460#issuecomment-2994101019
2025-06-22test: do not add legacy bindings to PYTHONPATHMichael J Gruber
d526797a ("python: move legacy python bindings to contrib.", 2025-02-15) moved the legacy python bindings away from the location in `bindingss/`. Do not add that location to the PYTHONPATH since it is obsolete.
2025-03-13emacs/tree: call notmuch-hl-line-mode from tree-sentinelDavid Bremner
There is a a perceptible gap between when the tree shows up and when the hl-line is visible, but this is better than the previous state where the line did not show up at all until the user moved the cursor.
2025-03-13emacs/tree: condition hl-line-mode on notmuch-hl-lineDavid Bremner
It isn't clear that this call to hl-line-mode will survive the coming re-organization to stop relying on hooks, but incrementally this at least makes the disabling behaviour consistent.
2025-03-13emacs: replace use of hook to draw hl-line in search modeDavid Bremner
In the thread at id:87fsfuuxwn.fsf@thinkbox, a bug is discussed where the point and hl-line overlay get out of sync, leading the user to open the wrong message. As far as I can tell this is caused by notmuch-hl-mode being invoked too early. This change bypasses the logic preventing notmuch-search-hook being called only once, so that the overlay is updated later after the buffer is full(er). This change may lead to the overlay being updated multiple times; if this is annoying we can add a similar buffer local variable to ensure it is only called once. The extra logic to check notmuch-search-target-line reduces the flicker somewhat by not highlighting the first line every time.
2025-03-13test/emacs: add tests for hl-line-mode integrationDavid Bremner
Most of the known broken tests replicate (my intepretation of) the bug reported at id:87fsfuuxwn.fsf@thinkbox (or some unreported, but probably related bugs in tree/unthreaded view). The last 3 broken tests are just unimplimented planned functionality.
2025-02-28Accept "key-missing" from a signature from a revoked keyDaniel Kahn Gillmor
We have traditionally expected a signature to show up as "revoked" when the signing key is revoked. However, GnuPG's recent fix to avoid a denial of service against legitimate signatures appears to have changed the status of signature verification from keys which happen to have been revoked. See https://bugs.debian.org/1098995 and https://dev.gnupg.org/T7547 This change makes the test suite a little bit less brittle while we look for a resolution from upstream. It should probably also be backported to debian unstable unless a notmuch release to unstable is imminent. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-25test/emacs: add workaround for Emacs 30 pp changesDavid Bremner
This relies on the fact that setting pp-default-function has no effect for Emacs <30.
2025-02-22test/message-property: convert python tests from legacy bindingsDavid Bremner
One test is deleted since that method is not provided by the new bindings. Similar things can be done by accessing the PropertiesMap returned by properties. This change is a prelude to removing the legacy bindings from the build.
2025-02-22test/count: convert library test from python to CDavid Bremner
The new python bindings do not support modifying query objects, so convert to C. There is a bit more boilerplate to handle errors but otherwise it is essentially a line by line translation.
2025-02-22test: drop tests for legacy python bindingsDavid Bremner
This is a prelude to removing the legacy bindings from the build.
2024-08-06emacs/tree: sanitize subjects when drawing treeDavid Bremner
This fixes the bug reported in id:6F2EF901-8B4B-44FF-83C5-22F732BA95A6@gmail.com Unfortunately it turns out our test data has several tabs in the subject lines. The expected output was updated to reflect their removal and the ripple effect of several more subjects matching the previous ones.
2024-08-06test/emacs-tree: add known broken test for subject with CR/NLDavid Bremner
The test is intentionally vague as it's hard to pin down the correct output before the code is fixed.
2024-08-06test/emacs-show: add regression test for subjects with CR/NLDavid Bremner
This subject is known to be problematic for notmuch-tree.
2024-08-06CLI/show: warn if crypto options are used with mbox formatDavid Bremner
This limitation seems somewhat hard to fix, but at least try to warn users when combining crypto operations with mbox output format. Because the default is --decrypt=auto, the warning is omitted if --decrypt=auto is specified. While this is not great, it seems more wrong to always warn, or to change the default because of this.
2024-07-26config: allow custom separators in author listsLars Kotthoff
Allow distinguishing between commas separating authors and separating first and last names. Amended by db: reformat NEWS entry and commit message. Tweaked whitespace in lib/thread.cc.
2024-07-25test/emacs: test notmuch-mua-subject-checkTony Zorman
Amended by db: rename test file to avoid collision.
2024-07-25CLI: update commentary in config file to better match codeDavid Bremner
This comment has been out of date since notmuch 0.32. Although it isn't really possible to explain all the options here, explain both one new "split" way of doing things and the traditional one with database inside $MAIL_ROOT/.notmuch.
2024-07-25lib: thread-safe s-expression query parserKevin Boulain
Follow-up of 6273966d, now that sfsexp 1.4.1 doesn't rely on globals anymore by default (https://github.com/mjsottile/sfsexp/issues/21). This simply defers the initial query generation to use the thread-safe helper (xapian_query_match_all) instead of Xapian::Query::MatchAll.
2024-07-25CLI/git: add reset commandDavid Bremner
Sometimes merging is not what we want with tags; in particular it tends to keep tags in the local repo that have been removed elsewhere. This commit provides a new reset command; the reset itself is trivial, but the work is to provide a safety check that uses the existing --force and git.safe_fraction machinery.
2024-06-19Replace `delete-line` with its definitionMichael J Gruber
37c022ae ("Use `without-restriction` in `with-temporary-notmuch-message-buffer`", 2024-03-14) introduced `delete-line` in a test, but this is Emacs 29 and above only. Replace it with its (almost) definition.
2024-06-15Use `without-restriction` in `with-temporary-notmuch-message-buffer`Marc Fargas
This ensures that the temporary copy of the current message-mode buffer is whole and not limited by a current restriction. An example of such restriction is the default one established by message-mode when composing a reply, that hides the References, In-Reply-To and similar headers.
2024-06-15test/cli: Add known broken test for (missing) quoting in FromDavid Bremner
In [1], Jakub Wilk observes that the current behaviour is confusing since it looks like there are two mailboxes in From, while in fact there is only one. It seems to me that notmuch should at least quote the display-name part of a mailbox if it has "funny" characters in it, and perhaps always quote it. Either way will require changing the indexing code, since the structure is lost when writing the headers to the database. [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021614
2024-06-15emacs/show: fix for text/calendar displayDavid Bremner
In certain scenarios involving symlinks and setting find-file-visit-truename, text/calendar parts were not displayed properly. Following a suggestion of Al Haji-Ali [1], replace the use of get-file-buffer with find-buffer-visiting. [1]: id:m2wmneguh8.fsf@gmail.com
2024-06-15test/emacs: add tests for rendering text/calendar partsDavid Bremner
The first test is just a general regression test, while the second duplicates the problem discussed in the thread starting at [1]. [1]: id:m2leo2u0uo.fsf@gmail.com
2024-06-15test/emacs: add regression test for display of calendar parts.David Bremner
This will hopefully catch breakage due to either changes in Emacs (especially Gnus) or changes to the notmuch-show code.
2024-06-15test/corpora: add example with text/calendar attachmentDavid Bremner
Initially for testing rendering in Emacs.
2024-05-29test: re-enable duplicate UI tests in T460-emacs-treeDavid Bremner
These were disabled (accidentally?) in f63d14a8c12a.
2024-04-06emacs: Add new option notmuch-search-hide-excludedMohsin Kaleem
The new notmuch-search-hide-excluded option allows users to configure whether to show or hide excluded messages (as determined by search.exclude_tags in the local notmuch config file). It defaults to true for now to maintain backwards-compatibility with how notmuch-{search,tree} already worked. New commands notmuch-search-toggle-hide-excluded and notmuch-tree-toggle-exclude have also been added. They toggle the value of notmuch-search-hide-excluded for the search in the current search or tree buffer. It's bound to "i" in the respective keymaps for these modes. Lastly I've amended some calls to notmuch-tree and notmuch-unthreaded which didn't pass through the buffer local value of notmuch-search-oldest-first (and now notmuch-search-exclude). Examples of where I've done this include: + notmuch-jump-search + notmuch-tree-from-search-current-query + notmuch-unthreaded-from-search-current-query + notmuch-tree-from-search-thread A new test file for Emacs has been added which covers the usage of the new `notmuch-search-hide-excluded' option and interactively hiding or showing mail with excluded tags. These test cover the basic usage of the `notmuch-search-toggle-hide-excluded' command in notmuch-search, notmuch-tree and notmuch-unthreaded searches. These tests also cover the persistence of the current value of the hide-excluded mail option as a user switches from between these different search commands. [1]: id:87ilxlxsng.fsf@kisara.moe Amended-by: db, fix indentation in T461-emacs-search-exclude.sh
2023-12-06Merge branch 'release'David Bremner
2023-12-06lib: clear error message on success in _choose_database_pathDavid Bremner
Previously we both found a database and returned a message saying that the database could not be found (along with a success code). This change should prevent spurious error output.
2023-12-06test: add known broken test for incorrect error messageDavid Bremner
Duplicate bug reported in id:87wmtvcor5.fsf@alyssa.is The error message is nonsense, because notmuch config list actually includes the database in those two cases.
2023-09-23Merge branch 'release'David Bremner
2023-09-23Pass error message from GLib ini parser to CLIDavid Bremner
The function _notmuch_config_load_from_file is only called in two places in open.cc. Update internal API to match the idiom in open.cc. Adding a newline is needed for consistency with other status strings. Based in part on a patch [1] from Eric Blake. [1]: id:20230906153402.101471-1-eblake@redhat.com
2023-09-23test: add known broken subtest for the bad config error messageDavid Bremner
This is a bit fragile w.r.t. glib changing their error message, but it already helped me find one formatting bug, so for now I think it's worth it, instead of just grepping for "UTF-8".
2023-09-23CLI: exit with error when load_config returns an error.David Bremner
For now print a generic error message and exit with error on any non-success code. Previously the code exited, but with exit code zero, leading users / scripts to think the command had succeeded.
2023-09-23test: add known broken test for bad utf8 in configDavid Bremner
We should ideally print an informative error message, but at the very least we should not exit with success.
2023-09-02test: suppress all interceptors in glibKevin Boulain
On ppc64el, races are detected by TSan: WARNING: ThreadSanitizer: data race (pid=4520) Read of size 8 at 0x7ffff20016c0 by thread T1: #0 strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:386 (libtsan.so.2+0x77c0c) #1 strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:378 (libtsan.so.2+0x77c0c) #2 g_strdup ../../../glib/gstrfuncs.c:362 (libglib-2.0.so.0+0xa4ac4) Previous write of size 8 at 0x7ffff20016c0 by thread T2: #0 malloc ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:647 (libtsan.so.2+0x471f0) #1 g_malloc ../../../glib/gmem.c:130 (libglib-2.0.so.0+0x7bb68) Location is heap block of size 20 at 0x7ffff20016c0 allocated by thread T2: #0 malloc ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:647 (libtsan.so.2+0x471f0) #1 g_malloc ../../../glib/gmem.c:130 (libglib-2.0.so.0+0x7bb68) This appears to be a false positive in GLib, as explained at https://gitlab.gnome.org/GNOME/glib/-/issues/1672#note_1831968 In short, a call to fstat fails under TSan and GLib's g_sterror will intern the error message, which will be reused by other threads. Since upstream appears to be aware that GLib doesn't play nicely with TSan, suppress everything coming from the library instead of maintaining a fine grained list. Reported at https://buildd.debian.org/status/fetch.php?pkg=notmuch&arch=ppc64el&ver=0.38%7Erc0-1&stamp=1692959868&raw=0
2023-08-26test: minimize impact of native compilation.David Bremner
Native compilation is kindof useless in the test suite because we throw away the cache after every subtest. The test suite could in principle share an eln cache within a given test file; for now try to minimize the amount of native-compilation. There is an intermittent bug where emacs loses track of its default-directory; I suspect (but have no proof) that bug is related to native compilation and/or race conditions. This patch seems to prevent that bug (or at least reduce its frequency).
2023-08-21test/setup: ignore blank lines in generated configDavid Bremner
The presense of the blank lines between sections depends on the version of glib. Strip them before comparison.
2023-08-20test/emacs: adapt to breaking change in Gnus defaultsDavid Bremner
As of Emacs 29.1, In-Reply-To is in the default value for message-hidden-headers. We actually want to see that in the test suite, so remove it again. To future proof the tests, fix a default value for message-hidden-headers specifically for the test suite.
2023-07-21test: support testing notmuch as installedDavid Bremner
We put some effort into testing the built copy rather than some installed copy. On the other hand for people like packagers, testing the installed copy is also of interest. When NOTMUCH_TEST_INSTALLED is set to a nonempty value, tests do not require a built notmuch tree or running configure. Some of the tests marked as broken when running against installed notmuch are probably fixable.
2023-07-21test: Guess a value for NOTMUCH_PYTHONDavid Bremner
python3 will work for many people, and reduce the friction to running the tests without running configure first.