aboutsummaryrefslogtreecommitdiff
path: root/test/T050-new.sh
AgeCommit message (Collapse)Author
2023-04-02lib: index attachments with mime types matching index.as_textDavid Bremner
Instead of skipping indexing all attachments, we check of a (user configured) mime type that is indexable as text.
2023-02-20lib: add better diagnostics for over long filenames.David Bremner
Previously we just crashed with an internal error. With this change, the caller can handle it better. Update notmuch-new so that it doesn't crash with "unknown error code" because of this change.
2023-02-20test: add known broken test for diagnostics from over long filenames.David Bremner
Previously we tested over long directory names, add similar testing for over long filenames.
2023-01-05test: mark some tests as broken when run as root.David Bremner
File permission errors e.g., are hard to trigger as root.
2022-09-03test: add known broken test for indexing text/* attachmentsDavid Bremner
The general problem of indexing attachments requires some help to turn things into text, but (most?) text/* should be doable internally, possibly with optimizations as for the text/html case.
2022-01-16cli/new: only ignore .notmuch at top levelDavid Bremner
Since the bug was first reported in [1], notmuch has gained the ability to have the database located outside the mail root, hence this this change differs slightly from Jani's proposed solution [2] in not using notmuch_database_get_path, but rather the already retrieved mail_root. [1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org [2]: id:87ios5v59p.fsf@nikula.org
2022-01-16test: add known broken test for ignoring non-toplevel .notmuchDavid Bremner
In [1] Rob observed that notmuch new ignored directories called .notmuch everywhere in the tree, where they should only (and now, with split configs, at most) be ignored at the top level. Add a test to demonstrate the problem. [1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org
2021-12-04test/new: replace use of gdb in vanishing file testDavid Bremner
Unlike the similar change in T060-new, no symlink creation is needed here.
2021-12-04config: ignore leading/trailing spaces in ';'-delimited listsDavid Bremner
In [1] Ciprian observed that it was easy for users to mistakenly introduce leading and trailing space to new.tags when editing a notmuch config file. This commit strips spaces on either side of the ';' delimiter when splitting. In principle it would be possible to support tags (or other config values) with leading or trailing spaces by processing '\s' escapes in the input string. Currently such processing is not done. [1]: id:CA+Tk8fzjPLaEd3vL1f9ebk_bF_RV8PDTLzDupraTkCLCpJAmCg@mail.gmail.com
2021-12-04test: known broken tests for leading/trailing ws in configDavid Bremner
These tests duplicate the bug/misfeature reported in id:CA+Tk8fzjPLaEd3vL1f9ebk_bF_RV8PDTLzDupraTkCLCpJAmCg@mail.gmail.com
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-05-10lib/config: expand relative paths when reading from databaseDavid Bremner
This makes the treatment of relative paths consistent between the database and config files.
2021-05-10test: add known broken test for relative setting of mail_rootDavid Bremner
The behaviour should not change depending on where the configuration is stored.
2021-05-10lib/config: canonicalize paths relative to $HOME.David Bremner
Prior to 0.32, notmuch had the (undocumented) behaviour that it expanded a relative value of database.path with respect to $HOME. In 0.32 this was special cased for database.path but broken for database.mail_root, which causes problems for at least notmuch-new when database.path is set to a relative path. The change in T030-config.sh reflects a user visible, but hopefully harmless behaviour change; the expanded form of the paths will now be printed by notmuch config.
2021-05-10test: add known broken test for relative database path in newDavid Bremner
This test highlights a bug introduced in 0.32. The new split between path and mail_root does not properly canonicalize relative paths in the latter.
2021-03-18test: add known broken test for long directory bugDavid Bremner
In [1] Gregor Zattler explained the results of his hard work tracking down a bug in notmuch with long directories. This test duplicates the bug. [1]: id:20210317194728.GB5561@no.workgroup
2021-03-12test: clean up some extra whitespace.David Bremner
The extra space is mainly just untidy.
2021-02-06cli/new: convert to new config frameworkDavid Bremner
In addition to the same type of changes as converting other subcommands, add the possibility of creating a database at the top level. It would probably make sense to use this for insert as well.
2020-08-01test: drop use of db_endingDavid Bremner
This will allow the dropping of the test for the default ending from configure.
2018-05-26test: fix hardcoded paths in T050-new.shDavid Bremner
The previous paths will fail almost everywhere.
2018-05-22test: use --full-scan in T050-new.shDavid Bremner
Wherever the test relies on directories being scanned, this option should be used to avoid skipping them due to mtimes on directories matching the database.
2018-05-22test: add tests for notmuch new --full-scanDavid Bremner
Most of these just check that adding the flag does not break existing functionality. The one test that does check the full-scan functionality had to be rewritten to output debugging info.
2018-04-23lib: choose oldest message when breaking reference loopsDavid Bremner
This preserves a sensible thread order
2018-04-23test: add known broken test for thread ordering from a loopDavid Bremner
The previous loop handling code chooses the last message in the message list, which turns out to be the last in date order. See the comment in _notmuch_thread_create.
2018-04-20lib: break reference loop by choosing arbitrary top level msgDavid Bremner
Other parts of notmuch (e.g. notmuch show) expect each thread to contain at least one top level message, and crash if this expectation is not met.
2018-04-20test: add known broken test for indexing an In-Reply-To loop.David Bremner
This documents the bug discussed in id:87d10042pu.fsf@curie.anarc.at
2017-12-15test: test regexp based new.ignoreJani Nikula
Just some basics.
2017-10-20test: use $(dirname "$0") for sourcing test-lib.shJani Nikula
Don't assume the tests are always run from within the source tree.
2017-08-30test: Fix T050-new.sh on some Travis CI machinesVladimir Panteleev
On some system configurations, setting a breakpoint on the "add_file" function then issuing "continue" in gdb causes the debugger to seemingly jump over the add_file invocation. This results in a test failure, as the "Handle files vanishing between scandir and add_file" subtest expects add_file to be called and fail due to the vanishing file. The compiler optimization level also plays a role - the problem can be reproduced with CFLAGS having -O2 but not -Og. This problem was observed manifesting as a test failure on Travis CI configured with "dist: trusty" and "sudo: false". It was not reproducible on a local Docker image of Travis' runtime environment, so Travis' virtualization infrastructure likely plays a role as well. * T050-new.sh: Breakpoint notmuch_database_add_message instead of add_file to the same effect, and avoid bad gdb behaviour on Travis CI. Amended by db: s/notmuch_database_add_message/notmuch_database_index_file/ Somehow the wrapper function doesn't work as a breakpoint; perhaps due to inlining.
2017-03-09test: require test_begin_subtest before test_expect_codeJani Nikula
Unify the subtests by requiring test_begin_subtest before test_expect_code. (Similar change for test_expect_success has already been done.) This increases clarity in the test scripts by having a separate line for the start of the subtest with the heading, and makes it possible to simplify the test infrastructure by making all subtests similar.
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-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-04-12lib: fix handling of one character long directory names at top levelJani Nikula
The code to skip multiple slashes in _notmuch_database_split_path() skips back one character too much. This is compensated by a +1 in the length parameter to the strndup() call. Mostly this works fine, but if the path is to a file under a top level directory with one character long name, the directory part is mistaken to be part of the file name (slash == path in code). The returned directory name will be the empty string and the basename will be the full path, breaking the indexing logic in notmuch new. Fix the multiple slash skipping to keep the slash variable pointing at the last slash, and adjust strndup() accordingly. The bug was introduced in commit e890b0cf4011fd9fd77ebd87343379e4a778888b Author: Carl Worth <cworth@cworth.org> Date: Sat Dec 19 13:20:26 2009 -0800 database: Store the parent ID for each directory document. just a little over two months after the initial commit in the Notmuch code history, making this the longest living bug in Notmuch to date.
2016-04-12test: test one character long directory names at top levelJani Nikula
Yes, it's broken. Reported by h01ger on IRC.
2016-04-12test: cope with glass backend file naming variationsDavid Bremner
In several places in the test suite we intentionally corrupt the Xapian database in order to test error handling. This corruption is specific to the on-disk organization of the database, and that changed with the glass backend. We use the previously computed default backend to make the tests adapt to changing names.
2015-12-30cli: fix function name in notmuch new debug loggingJani Nikula
add_files_recursive has been renamed add_files long ago.
2015-10-14cli: delete directory documents on directory removal0.21_rc0Jani Nikula
There was a problem with the directory documents being left behind when the filesystem directory was removed. This was worked around in [1]. However, that ignored the fact that the directory documents are also still listed by notmuch_directory_get_child_directories() leading to confusing results when running notmuch new. The directory documents are found and queued for removal over and over again. Fix the problem for real by removing the directory documents. This fixes the tests flagged as broken in [2]. The (non-deterministic) hack test from [3] also still passes with this change. [1] commit acd66cdec075312944e527febd46382e54d99367 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3 [3] id:1441445731-4362-1-git-send-email-jani@nikula.org
2015-10-10test: flag one more notmuch new test as brokenJani Nikula
Drop the test update added in [1] and mark the test as broken, like the tests flagged as broken in [2]. These all reflect the same underlying breakage with (lack of) directory deletion. [1] commit e4e04bbc328f990e36b77f508aef904d156029b1 [2] commit ed9ceda623d3f22fb66365b33db63c5c982067d3
2015-08-07test: make script exit (1) if it "fails" to source (.) a fileTomi Ollila
The files (test) scripts source (with builtin command `.`) provides information which the scripts depend, and without the `source` to succeed allowing script to continue may lead to dangerous situations (e.g. rm -rf "${undefined_variable}"/*). At the end of all source (.) lines construct ' || exit 1' was added; In our case the script script will exit if it cannot find (or read) the file to be sourced. Additionally script would also exits if the last command of the sourced file exited nonzero.
2015-08-04test: add debugging output to notmuch-new tests, mark 5 as brokenDavid Bremner
I marked the tests where I really couldn't understand the output as broken. It could also be that I don't understand how directory removal is supposed to work.
2015-08-04cli/new: add more debugging outputDavid Bremner
Try to narrow down what part of the code adds files and directories to the queue(s) to be deleted. Update one test. The output is slightly confusing, but I believe it is correct, resulting from a directory being discovered but containing only ignored files.
2015-08-04test: don't claim single message mbox support is going awayDavid Bremner
We gave up on this.
2015-03-15test: Add two tests for error output from notmuch_database_openDavid Bremner
This is arguably testing the same thing twice, but in the brave new future where we don't use printf anymore, each subcommand will be responsible for handling the output on it's own.
2015-01-01lib: drop the deprecation message for single-message mbox filesJani Nikula
We generally do not support mbox files, but for historical reasons we've supported single-message mbox files, with a deprecation message. We've tried dropping the support altogether, but backed out of it because we'd need to stop indexing them, while keeping support for previously indexed files. This would be more complicated than simply supporting single-message mbox files. Therefore, drop the deprecation message, and just silently accept single-message mboxes.
2014-06-13lib: resurrect support for single-message mbox filesJani Nikula
This is effectively a revert of commit 6812136bf576d894591606d9e10096719054d1f9 Author: Jani Nikula <jani@nikula.org> Date: Mon Mar 31 00:21:48 2014 +0300 lib: drop support for single-message mbox files The intention was to drop support for indexing new single-message mbox files (and whether that was a good idea in the first place is arguable). However this inadvertently broke support for reading headers from previously indexed single-message mbox files, which is far worse. Distinguishing between the two cases would require more code than simply bringing back support for single-message mbox files.
2014-04-05lib: drop support for single-message mbox filesJani Nikula
We've supported mbox files containing a single message for historical reasons, but the support has been deprecated, with a warning message while indexing, since Notmuch 0.15. Finally drop the support, and consider all mbox files non-email.
2014-03-06test: add tests for invalid new.tagsJani Nikula
Similar tests for both notmuch new and insert.
2014-01-27test: add basic tests for notmuch new --quiet optionJani Nikula
This does not cover all the possible paths notmuch new could output stuff, but it's better than nothing.
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.