summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2017-06-01cli/dump: don't include tags when not asked forDavid Bremner
Add in the analogous test for tags that is given for properties a few lines below.
2017-06-01test: add known broken test --include=propertiesDavid Bremner
Reported in [1], --include=properties currently implies --include=tags, but it should not. [1] id:87y3u8vjbo.fsf@tethera.net
2017-04-01cli/dump: bump dump format version to 3David Bremner
No changes to the format of the body, but the header format was fixed, and version 2 headers probably shouldn't be relied on.
2017-04-01cli/dump: fix bug in dump headerDavid Bremner
Fix copy paste error.
2017-04-01test: add known broken test for dump headerDavid Bremner
Apparently nobody uses the list of "what was included in the dump"
2017-03-29lib: handle empty string in regexp field processorsDavid Bremner
The non-field processor behaviour is is convert the corresponding queries into a search for the unprefixed terms. This yields pretty surprising results so I decided to generate a query that would match the terms (i.e. none with that prefix) generated for an empty header.
2017-03-29test: add known broken test for null from: and subject: queryDavid Bremner
These queries currently fail with field processors enabled because the code expects a non-empty string.
2017-03-24lib: only trigger phrase processing for regexp fields when neededDavid Bremner
The argument is that if the string passed to the field processor has no spaces, then the added quotes won't have any benefit except for disabling wildcards. But disabling wildcards doesn't seem very useful in the normal Xapian query parser, since they're stripped before generating terms anyway. It does mean that the query 'from:"foo*"' will not be precisely equivalent to 'from:foo' as it is for the non field-processor version.
2017-03-24test: add known broken tests wildcard search in from and subjectDavid Bremner
This was broken by the addition of regexp searching. The detection of wildcards is not currently done in the recursive call to parse_query, because of quoting issues.
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".