aboutsummaryrefslogtreecommitdiff
path: root/test/dump-restore
AgeCommit message (Collapse)Author
2014-01-13test: renamed test scripts to format T\d\d\d-name.shTomi Ollila
All test scripts to be executed are now named as T\d\d\d-name.sh, numers in increments of 10. This eases adding new tests and developers to see which are test scripts that are executed by test suite and in which order.
2013-01-06dump/restore: Use Xapian queries for batch-tag formatAustin Clements
This switches the new batch-tag format away from using a home-grown hex-encoding scheme for message IDs in the dump to simply using Xapian queries with Xapian quoting syntax. This has a variety of advantages beyond presenting a cleaner and more consistent interface. Foremost is that it will dramatically simplify the quoting for batch tagging, which shares the same input format. While the hex-encoding is no better or worse for the simple ID queries used by dump/restore, it becomes onerous for general-purpose queries used in batch tagging. It also better handles strange cases like "id:foo and bar", since this is no longer syntactically valid.
2013-01-06notmuch-restore: handle empty input file, leading blank lines and comments.David Bremner
This patch corrects several undesirable behaviours: 1) Empty files were not detected, leading to buffer read overrun. 2) An initial blank line cause restore to silently abort 3) Initial comment line caused format detection to fail
2013-01-06test/dump-restore: new tests for empty files and leading comments/whitespace.David Bremner
Three of these are marked broken; the third is a regression test, since it passes by virtue of batch-tag being the default input format.
2012-12-09test/dump-restore: add test for warning/error messagesDavid Bremner
We want to test both that error/warning messages are generated when they should be, and not generated when they should not be. This varies between restore and batch tagging.
2012-12-09test: second set of dump/restore --format=batch-tag testsDavid Bremner
These one need the completed functionality in notmuch-restore. Fairly exotic tags are tested, but no weird message id's. We test each possible input to autodetection, both explicit (with --format=auto) and implicit (without --format).
2012-12-09test: update dump-restore roundtripping test for batch-tag formatDavid Bremner
Now we can actually round trip these crazy tags and and message ids. hex-xcode is no longer needed as it's built in.
2012-12-08test: add sanity check for dump --format=batch-tag.David Bremner
It's important this does not rely on restore, since it hasn't been written yet.
2012-12-02test: add broken roundtrip testDavid Bremner
We demonstrate the current notmuch restore parser being confused by message-id's and tags containing non alpha numeric characters (particularly space and parentheses are problematic because they are not escaped by notmuch dump). We save the files as hex escaped on disk so that terminal emulators will not get confused if the test fails (as we mostly expect it to do).
2012-11-17test: add nontrivial test for restore --accumulate.David Bremner
It seems we have never tested the case that restore --accumulate actually adds tags. I noticed this when I started optimizing and no tests failed. The bracketing with "restore --input=dump.expected" are to make sure we start in a known state, and we leave the database in a known state for the next test.
2012-11-17test: add more informative titles to restore --accumulate testsDavid Bremner
Thanks to Ethan for the suggestion.
2012-08-06notmuch-restore: replace positional argument for input with optionDavid Bremner
Since notmuch dump doesn't use positional arguments anymore, it seems better to be consistent.
2012-08-06notmuch-dump: remove deprecated positional argument for output fileDavid Bremner
The syntax --output=filename is a smaller change than deleting the output argument completely, and conceivably useful e.g. when running notmuch under a debugger.
2011-10-23notmuch-restore: check for extra arguments.David Bremner
We consider it an error to pass more than one file to restore, since extra ones are ignored.
2011-10-23notmuch-restore: implement --accumulate optionDavid Bremner
Modify command line argument handling to take a --accumulate flag. Test for extra arguments beyond the input file. The --accumulate switch causes the union of the existing and new tags to be applied, instead of replacing each message's tags as they are read in from the dump file. Based on a patch by Thomas Schwinge: id:"1317317857-29636-1-git-send-email-thomas@schwinge.name"
2011-10-23test/dump-restore: add tests for restore --accumulateDavid Bremner
Flesh out what ``notmuch restore --accumulate'' is supposed to do. Its tests are currently XFAILed; the functionality will be added in future patch(es). Based on a patch by Thomas Schwinge: id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"
2011-10-23test/dump-restore: Fix quoting on grepDavid Bremner
Thanks to Thomas Schwinge for noticing yet another place where quoting matters. Since the shell translates \. to ., the regex passed to grep is too generous without the quotes. The use of [.] is the suggestion of Tomi Ollila.
2011-10-22test/dump-restore: expand test suite for dump-restore, make more robustDavid Bremner
Several new tests are added, and existing use of test_begin_subtest is replaced by test_expect_success to catch failing commands in cases where we execute more than one command. Based on changes in id:"1317317811-29540-1-git-send-email-thomas@schwinge.name"
2011-10-16notmuch-dump: deprecate use of output file argument.David Bremner
We print an intentionally non-specific message on stderr, since it isn't clear if there will be some global output file argument to replace. We update the test suite atomically, since it relies on having the same text in two files.
2011-10-16notmuch-dump: treat any remaining arguments after the filename as search termsDavid Bremner
The main motivation here is allow the fast dumping of tag data for messages having certain tags. In practice it seems too slow to pipe dump to grep. All dump-restore tests should be working now, so we update test/dump-restore accordingly
2011-10-16test: add tests for command line arguments to notmuch-dumpDavid Bremner
The plan is to add the possibility of search terms after the file name, and the use of -- to stop looking for an output file name.
2011-10-12test: update dump-restore to use redirection instead of filename argsDavid Bremner
The idea here is that we want to deprecate the use of arguments to dump and restore to specify paths, since in particular we want to use the non-option arguments to dump to form a query.
2011-05-27test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portabilityJoel Borggrén-Franck
Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way systems running on bash < 4 can prepend bash >= 4 to path before running the tests.
2010-09-20test: Fix the search and dump-restore tests to operator on non-empty mail store.Carl Worth
We do this with a new add_email_corpus function that establishes a mail store with 50 messages from the notmuch mailing list.
2010-09-20test: Remove useless NOTMUCH variable (in favor of simply "notmuch")Carl Worth
When the NOTMUCH variable was originally invented it was used as an explicit path to the notmuch binary being tested. Today, the test suite sets the PATH variable instead, so the NOTMUCH variable always has a value of simply "notmuch". We simplifying that by using the constant value rather than the continual variable reference.
2010-09-17test: Rename all tests to get rid of the ugly numbers in file names.Carl Worth
The numbers were meaningless, and they made it hard to find a file of interest. Instead, we get the ordering we want by adding an explicit list of tests to run to the notmuch-test script.