From 7a0e093e467ea39fe4e662f9cd6d135b0f036876 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 2 Aug 2026 17:53:29 +0200 Subject: docs: unit-test NotmuchWorker against a throwaway database The spec deferred NotmuchWorker to manual verification on the grounds that testing it needs a real notmuch database. Building a fake one in a temporary directory answers that objection, so Task 8 now gets real coverage. This is the only code in the project that writes to a notmuch index, so a bug there corrupts real mail state. It was the wrong place to have the weakest verification. Task 13's manual checklist stays, as confirmation against real data rather than as the only coverage. Co-Authored-By: Claude Opus 5 --- docs/superpowers/specs/2026-08-02-qtmaildir-design.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'docs/superpowers/specs') diff --git a/docs/superpowers/specs/2026-08-02-qtmaildir-design.md b/docs/superpowers/specs/2026-08-02-qtmaildir-design.md index 0f49b61..37a0078 100644 --- a/docs/superpowers/specs/2026-08-02-qtmaildir-design.md +++ b/docs/superpowers/specs/2026-08-02-qtmaildir-design.md @@ -429,9 +429,13 @@ Qt Test, three targets, all runnable without a real mailbox. ## 14. Known gaps -- `NotmuchWorker` is not unit-tested. Testing it requires a real notmuch - database; v1 tests pure logic and leaves the database layer to manual - verification. +- ~~`NotmuchWorker` is not unit-tested.~~ **Resolved 2026-08-02.** It is + tested against a throwaway notmuch database built in a temporary directory + by the test fixture (`notmuch new` over a generated Maildir, with + `NOTMUCH_CONFIG` pointed at it). The original reasoning — that testing + requires a real database — was answered by building a fake one instead of + skipping the tests. This is the only code that writes to a notmuch index, + so it warranted the effort. - Large-message MIME parsing happens on the UI thread and could stutter on pathological messages. Opening a thread parses every message in it, so this is more likely to show on a long thread than on a single message. Deferred -- cgit v1.2.3