[PATCH] WIP: new insert tests for failing indexing.
The second one fails because the initial write lock fails. I guess this is maybe a doc bug. --- test/T070-insert.sh | 21 + 1 file changed, 21 insertions(+) This is what I came up with when trying to induce indexing failure. The best I could do was make the initial notmuch open fail. This means my second test is broken. When I was writing the commit message I was thinking the man page was therefore wrong, but actually it's ok. I did wonder if it might be a good idea to move the database open after the message is written to disk, is we want to maximize the chance of insert --keep "succeeding". diff --git a/test/T070-insert.sh b/test/T070-insert.sh index aacc643..e7d0ae1 100755 --- a/test/T070-insert.sh +++ b/test/T070-insert.sh @@ -183,4 +183,25 @@ test_expect_code 1 "Invalid tags set exit code" \ notmuch config set new.tags $OLDCONFIG + +gen_insert_msg +test_python <&1' + +test_expect_code 0 "Zero exit code due to --keep flag" \ +'notmuch insert --keep < "$gen_msg_filename" 2>&1' + +kill $(cat ${TMP_DIRECTORY}/write-locker.pid) >/dev/null 2>&1 + test_done -- 2.1.0
[PATCH 1/5] cli: Refactor option passing in the search command
On Thu, 25 Sep 2014, Michal Sojka wrote: > On Thu, Sep 25 2014, Tomi Ollila wrote: >> Although the test and the implementation in the next patches look OK, I'd >> prefer the FLAG implementation Jani suggested earlier. IMO now that I >> compare these two it looks cleaner and simpler... > > The question is which kind of simplicity you have in mind. I think that > my version is simpler to type (less keystrokes). But if others have > different opinion, I don't mind. I'm biased, but I do like the implementation simplicity of my approach. Adding the bash completion support is also trivial. BR, Jani.
[PATCH 1/5] cli: Refactor option passing in the search command
On Thu, Sep 25 2014, Michal Sojka wrote: > On Thu, Sep 25 2014, Tomi Ollila wrote: >> On Mon, Sep 22 2014, Michal Sojka wrote: >> >>> Many functions that implement the search command need to access command >>> line options. Instead of passing each option in a separate variable, put >>> them in a structure and pass only this structure. >> >> This patch looks good to me. > > Thanks for the review. > >> Although the test and the implementation in the next patches look OK, I'd >> prefer the FLAG implementation Jani suggested earlier. IMO now that I >> compare these two it looks cleaner and simpler... > > The question is which kind of simplicity you have in mind. I think that > my version is simpler to type (less keystrokes). But if others have > different opinion, I don't mind. Less keystrokes for sure -- but these interfaces are usually accessed programmatically... :D >> >> Tomi >> >> (*) IMO the default unique (when requested) would be exact case-sensitive >> match of full name & address > > Why do you think that case-sensitive address matching should be the > default? In theory local-part can be case sensitive, but I've never seen > that in reality. So this default would only be useful if you want to > research how people type your email address :) Well, in short, I think the lowest level of uniqueness should be simple string match, and this should at least be available if not default -- to the extent gmime provides (maybe that is this way in your patch...), ...and therefore I'd like to have this address output solved first, then we can experiment with the outputs provided and have better-educated comments on this issue... >> parts (phrase, address & comment); > > What do you mean by phrase and comment? Address syntax is defined by > http://tools.ietf.org/html/rfc5322#section-3.4.1. in "Foo Bar" (company/city) foo.bar at example.org and "Foo Bar" foo.bar at example.org (company/city) Phrase would be "Foo Bar" Address foo.bar at example.org and comment (company/city) As a side note, nottoomuch-addresses does some heuristics there, and think the 2 options above are equal (as "Phrase" (comment) address) -- which might the same InternetAddressMailbox provides :O Also, it seems that nottoomuch-addresses lowercases 'address' for comparison and storage ... I am not entirely sure whether I should provide options to disable these heuristics -- if someone asks for the feature then I probably will do :D >> then (a subset of possible) options could be: >>+) case-insensitive (first match taken (or last match?) -- option?) >>+) unique email addresses (take phrase/comment from first/last?) >> -- or use first that has something additional to plain address >> -- or use last that has something additional to plain address > > Yes, there is a lot of possible options. I don't think that notmuch has > to support all of them. If people need something special like "use last > that has something additional to plain address", they can always do > --unique=none and do their own post-processing. Ok, but something (we can further bikeshed with) needs to be selected :D > > -Michal Tomi
[PATCH] WIP: new insert tests for failing indexing.
The second one fails because the initial write lock fails. I guess this is maybe a doc bug. --- test/T070-insert.sh | 21 + 1 file changed, 21 insertions(+) This is what I came up with when trying to induce indexing failure. The best I could do was make the initial notmuch open fail. This means my second test is broken. When I was writing the commit message I was thinking the man page was therefore wrong, but actually it's ok. I did wonder if it might be a good idea to move the database open after the message is written to disk, is we want to maximize the chance of insert --keep succeeding. diff --git a/test/T070-insert.sh b/test/T070-insert.sh index aacc643..e7d0ae1 100755 --- a/test/T070-insert.sh +++ b/test/T070-insert.sh @@ -183,4 +183,25 @@ test_expect_code 1 Invalid tags set exit code \ notmuch config set new.tags $OLDCONFIG + +gen_insert_msg +test_python EOF +import notmuch, time, os +with open(write-locker.pid,w) as pidfile: +pidfile.write(str(os.getpid())) +db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE) +time.sleep(120) +EOF + +# give time for the background process to get started +sleep 1 + +test_expect_code 1 Non-zero exit code due to write lock \ +'notmuch insert $gen_msg_filename 21' + +test_expect_code 0 Zero exit code due to --keep flag \ +'notmuch insert --keep $gen_msg_filename 21' + +kill $(cat ${TMP_DIRECTORY}/write-locker.pid) /dev/null 21 + test_done -- 2.1.0 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch