summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-03-04test: shrink T590-thread-breakage test decription to one lineJani Nikula
The test description is used for log output, I think the intention is to keep it as a one-liner. Leave the rest of the long description as a comment.
2017-03-04Test: emacs: test for folding long headers.Mark Walters
Headers of more than 998 characters should be folded when sending. However, until recently, emacs did not do this. This adds a (known broken) test for this when sending messages in emacs. We will backport the fix to notmuch-emacs in the next changeset.
2017-03-04lib: query make exclude handling non-destructiveDavid Bremner
We filter added exclude at add time, rather than modifying the query by count search. As noted in the comments, there are several ignored conditions here.
2017-03-04lib: centralize query parsing, store results.David Bremner
The main goal is to prepare the way for non-destructive (or at least less destructive) exclude tag handling. It does this by having a pre-parsed query available for further processing. This also allows us to provide slightly more precise error messages.
2017-03-03lib: add mid: as a synonym for id:David Bremner
mid: is the url scheme suggested by URL 2392. We also plan to introduce more flexible searches for mid: than are possible with id: (in order not to break assumptions about the special behaviour of id:, e.g. identifying at most one message).
2017-03-03lib: regexp matching in 'subject' and 'from'David Bremner
the idea is that you can run % notmuch search subject:/<your-favourite-regexp>/ % notmuch search from:/<your-favourite-regexp>/ or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This feature is only available with recent Xapian, specifically support for field processors is needed. It should work with bindings, since it extends the query parser. This is easy to extend for other value slots, but currently the only value slots are date, message_id, from, subject, and last_mod. Date is already searchable; message_id is left for a followup commit. This was originally written by Austin Clements, and ported to Xapian field processors (from Austin's custom query parser) by yours truly.
2017-02-28Merge branch 'release'David Bremner
Second gnugpg test suite fix
2017-02-28cli/show: add content-disposition to structured output message partsJani Nikula
Help the clients decide how to display parts. Test updates by Mark Walters <markwalters1009@gmail.com>. One more test fix by db
2017-02-27test: move GNUPGHOME to TEST_TMPDIRDavid Bremner
We already use this directory for dtach sockets, so it makes sense to put gnupg sockets there as well. There doesn't seem to be a clean way to put a fully functional socket in a different location than GNUPGHOME.
2017-02-27Revert "test: use gpgconf --create-socketdir if available"David Bremner
This reverts commit e7b88e8b0a93ca83d807edc00e0c97af54c5b5f1. It turns out that this does not work well in environments without a running systemd (or some other provider of /run/user)
2017-02-26test: make T640 compatible with old C compilersDavid Bremner
Apparently our test system does not use the same flags for compiling tests as it does for compiling notmuch. Make the test compatible with C89. Also remove one unused loop index.
2017-02-26test: test format version difference between v2 and v3Jani Nikula
Schemata v3 changed message filename field to a list. Test both versions 2 and 3.
2017-02-26cli/show: list all filenames of a message in the formatted outputJani Nikula
Instead of just having the first filename for the message, list all duplicate filenames of the message as a list in the formatted outputs. This bumps the format version to 3.
2017-02-25lib: handle DatabaseModifiedError in _n_message_ensure_metadataDavid Bremner
The retries are hardcoded to a small number, and error handling aborts than propagating errors from notmuch_database_reopen. These are both somewhat justified by the assumption that most things that can go wrong in Xapian::Database::reopen are rare and fatal. Here's the brief discussion with Xapian upstream: 24-02-2017 08:12:57 < bremner> any intuition about how likely Xapian::Database::reopen is to fail? I'm catching a DatabaseModifiedError somewhere where handling any further errors is tricky, and wondering about treating a failed reopen as as "the impossible happened, stopping" 24-02-2017 16:22:34 < olly> bremner: there should not be much scope for failure - stuff like out of memory or disk errors, which are probably a good enough excuse to stop
2017-02-25test: add known broken test for uncaught DatabaseModifiedErrorDavid Bremner
There are several of these to track down, but one that is in quite a few code paths is _notmuch_message_ensure_metadata.
2017-02-23test: replaced use of python with $NOTMUCH_PYTHON (twice)Tomi Ollila
$NOTMUCH_PYTHON is sourced from sh.config, configured by ./configure and stated to be used as: "Name of python command to use in configure and the test suite."
2017-02-21Merge branch 'release'David Bremner
Merge changes to use gpgconf --create-socketdir
2017-02-21test: use gpgconf --create-socketdir if availableDavid Bremner
This enables the shortened socket pathes in /run or equivalent. The explicit call to gpgconf is needed for nonstandard GNUPGHOME settings. (amended according to id:m2fujatr4k.fsf@guru.guru-group.fi)
2017-01-27test: wrap 'wc -l' results in arithmetic evaluation to strip whitespaceTomi Ollila
Some new unwrapped 'wc -l's have been added since Jani's 60e79e3a9f1c8
2017-01-08test: allow user to choose which gdb to run tests withTomi Ollila
The variable used for selecting gdb is TEST_GDB, consistent with TEST_CC and TEST_EMACS{,CLIENT}.
2016-12-07Merge branch 'release'David Bremner
Merge changes for notmuch-insert error handling, debian bugfix release
2016-12-07cli/insert: return EX_TEMPFAIL for some errorsDavid Bremner
Attempt to distinguish between errors indicating misconfiguration or programmer error, which we consider "permanent", in the sense that automatic retries are unlikely to be useful, and those indicating transient error conditions. We consider XAPIAN_EXCEPTION transient because it covers the important special case of locking failure.
2016-12-07test: gdb insert: redirect input inside gdb scriptTomi Ollila
Running `gdb command < input` is not as reliable way to give input to the command (some installations of gdb consume it). Use "set args" gdb command to have input redirected at gdb 'run' time.
2016-12-03test: check the handling of files vanishing between scandir and indexingJani Nikula
Add a file for scandir to find, but use gdb to remove it before it gets indexed.
2016-12-03test: clean up corpora.emailDavid Bremner
When we renamed corpus to corpora, we missed a spot.
2016-11-24Merge branch 'release'David Bremner
Initial set of changes for 0.23.3
2016-11-24tests: account for varying-size cryptographic signaturesDaniel Kahn Gillmor
GnuPG 2.1.16 is now injecting the full issuer fingerprint in its signatures, which makes them about 32 octets larger when ascii-armored. This change in size means that the size of the MIME parts will vary depending on the version of gpg that the user has installed. at any rate, the signature part should be non-zero (this is true for basically any MIME part), so we just test for that instead of an exact size.
2016-11-14Test: fix draft test for emacs23Mark Walters
emacs24 and emacs23 have different secure tag defaults: in particular, mml-secure-message-sign only signs the part on emacs23 but the whole message on emacs24. This difference makes one of the draft tests fail (which causes a cascade of later failures) on emacs23. It seems that travis uses emacs23 so it is useful to fix this. We do this by forcing the whole message to be signed in either case -- the code snippet is extracted from mml-secure-message-sign on emacs24.
2016-11-13emacs: resume messagesDavid Bremner
Provide functionality to resume editing a message previously saved with notmuch-draft-save, including decoding the X-Notmuch-Emacs-Secure header. Resume gets the raw file from notmuch and using the emacs function mime-to-mml reconstructs the message (including attachments). 'e' is bound to resume a draft from show or tree mode.
2016-11-13emacs: check drafts for encryption tags before savingDavid Bremner
In general the user may not want to save plaintext copies of messages that they are sending encrypted, so give them a chance to abort.
2016-11-13emacs: postpone a messageMark Walters
This provides initial support for postponing in the emacs frontend; resuming will follow in a later commit. On saving/postponing it uses notmuch insert to put the message in the notmuch database Current bindings are C-x C-s to save a draft, C-c C-p to postpone a draft (save and exit compose buffer). Previous drafts get tagged deleted on subsequent saves, or on the message being sent. Each draft gets its own message-id, and we use the namespace draft-.... for draft message ids (so, at least for most people, drafts are easily distinguisable).
2016-10-25test/test-lib.sh: execute basename(1)s lazier in test_expect_equal_file ()Tomi Ollila
Moved the 2 basename(1) executions to the test failure branch in test_expect_equal_file (). The output of basename(1) executions in function test_expect_equal_file () are only used when tests fails -- when all tests pass these 2 basename(1) executions are no longer done at all.
2016-10-22Merge in test-suite, docstring fixes, release prepDavid Bremner
2016-10-22test: use vt100 as "smart" terminal for known dumb/unknown terminalsTomi Ollila
Otherwise use whatever user environment has set for TERM so that there is more chance to test on users' actual environments.
2016-10-22test-lib.sh: rename $DTACH_TERM to $SMART_TERMTomi Ollila
2016-10-15test: add known broken test for nondestructiveness of countDavid Bremner
Thanks to Lucas (id:147263183913.27784.12274024193186585889@mbp) for the bug report and the test case. I decided to use the python version because the python bindings could use more exercise.
2016-10-11test/T000-basic: replaced use of which(1) with shell builtin command -vTomi Ollila
Some minimal chroot/container environments don't have which(1) installed.
2016-09-24test: test-lib.sh: use $BASH instead of ${SHELL-sh} to relaunchTomi Ollila
In case of the test script is to be relaunced under valgrind, or --tee is requested, use the $BASH shell variable to locate the command interpreter. The $SHELL variable is re-set by non-interactive shells so in case the shell uses some other shell (e.g. zsh) for interactive use these bash scripts continue to work.
2016-09-24test/emacs: add broken test for message replying to msg to selfDavid Bremner
This is a strange corner case where the removing of the user's address from the To: header does the wrong thing. If we think it is worth (eventually) fixing, this test can serve as a reminder.
2016-09-22test: fix printf formatDavid Bremner
notmuch_status_t is an integer type, printing it as a string is a very bad idea.
2016-09-21add property: query prefix to search for specific propertiesDaniel Kahn Gillmor
We want to be able to query the properties directly, like: notmuch count property:foo=bar which should return a count of messages where the property with key "foo" has value equal to "bar".
2016-09-21cli: optionally restore message properties from dump fileDavid Bremner
This somewhat mimics the config line parsing, except there can be arbitrarily many key value pairs, so one more level of looping is required.
2016-09-21CLI: add properties to dump outputDavid Bremner
Part of providing extensibility via properties is to make sure that user data is not lost. Thus we need to be able to dump and restore properties.
2016-09-21lib: iterator API for message propertiesDavid Bremner
This is a thin wrapper around the string map iterator API just introduced.
2016-09-21lib: basic message-property APIDavid Bremner
Initially, support get, set and removal of single key/value pair, as well as removing all properties.
2016-09-19test: silence the output of notmuch new mid-testJani Nikula
Fix this during test run: T470-missing-headers: Testing messages with missing headers Added 2 new messages to the database.
2016-09-18emacs: reply: remove wrong sig/enc status buttonsMark Walters
This stops the (usually incorrect) sigstatus and encstatus buttons appearing when replying in emacs, and updates the test suite to match. Overriding the status button functions is a little unusual but much less intrusive than passing an argument all the way down the call chain. It also makes it clear exactly what it does. We also hide the application/pgp-encrypted part as it can only contain "Version: 1". We do this in notmuch show, which means it also happens when replying.
2016-09-18test/crypto: test reply to encrypted message in emacsDavid Bremner
This test considers the extra output about encryption/signature status as a bug, to be fixed in the next commit
2016-09-17cli/reply: return internet address list from get header funcsJani Nikula
Pass in GMimeMessage to simplify To/Cc/Bcc headers. We'll eventually remove the notmuch message passing altogether, but keep both for now to not make too big changes at once. Getting the headers from GMimeMessage using GMime functions fixes the error on duplicate Cc headers reported by Daniel Kahn Gillmor <dkg@fifthhorseman.net> in id:87d1ngv95p.fsf@alice.fifthhorseman.net. Get rid of an intermediate function. The small annoyance is the ownership differences in the address lists.
2016-09-17test: add known broken test for reply to message with multiple Cc headersJani Nikula
As Daniel Kahn Gillmor <dkg@fifthhorseman.net> reports in id:87d1ngv95p.fsf@alice.fifthhorseman.net, notmuch show combines multiple Cc: fields into one, while notmuch reply does not. While such messages are in violation of RFC 5322, it would be reasonable to expect notmuch to be consistent. Add a known broken test to document this expectation. This also starts a new "broken" corpus for messages which are broken. Details: The original message is formatted using the message printing in notmuch-show.c. For Cc:, it uses g_mime_message_get_recipients(), which apparently combines all Cc: fields into one internally. The addresses in the reply headers, OTOH, are based on headers queried through libnotmuch. It boils down to g_mime_object_get_header() in lib/message-file.c, which returns only the first occurence of header.