No test drives the read-model replay end to end: a test's reads reach evoq's default store, not the service's #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (test coverage): the replay that fills the letter read model at every start is exercised by a test, so a defect in it (the wrong store, a gate opened over an empty table) fails a test instead of reaching a review.
The replay added for macula-ci-images#19 has no automated test that drives it end to end. The one that was written for it was dropped because, as far as its author could tell, a test could not start this service's store:
mcl_mail_store:ensure/2reachesreckon_db_sup:start_store, the store loggedRetry attempt N for store default_store … no_workers, and reads never completed. The 3,000-letter measurement in the pinned CI image stands in for it, by agreement with the dispatcher.A later measurement found the log lines naming
default_storeare not the store's own start:default_storeis evoq's.appdefaultstore_id, and that default is what the app reads once it is loaded, so a value set beforeapplication:ensure_all_started(evoq)is not the one evoq uses. A release boot hasconfig/sys.config.srcset it (and a test compares that value withmcl_mail_service:event_store/0's id), which is why the service itself is not affected. The store the service opens ismcl_mail_store, and reads named against it work in the same process that fails againstdefault_store.What the dropped test covered, and what a test should still cover: one mailbox opened through the real desks (
initiate_mailbox_v1, thenopen_mailbox_v1— the aggregate refuses a deposit into an initiated-but-unopened mailbox), two letters deposited throughmaybe_deposit_letter:dispatch, one read-model owner started, and both letters read back, newest first, in one page.Done when: the replay is exercised end to end by a test in CI — the store started, letters deposited through the real desks, one owner started, and the deposits read back after the gate opens — or a comment here shows why that store cannot be started inside a test, with the measurement's script kept as the standing proof.
Found while measuring the replay for macula-ci-images#19 (PR 26). Refs macula-ci-images#19