Parity PR 4b: no subscribers in tests; PRJ and QRY tests (#4) #16
Loading…
Reference in a new issue
No description provided.
Delete branch "mercurius/4-pr4b-subscriber-tests"
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 (feature): no host_bookclub subscriber runs in the test env, so store tests stop planning parties and trying the mesh behind each other's backs (the latent flake). The read side gets E's tests: replay idempotence, the schema contract, store delivery, and QRY's boundary and id refusals. This is PR 4b of #4, the rest of gap table H.4, stacked on PR 4: the base is mercurius/4-pr4-emitters.
Refs #4
What changes (in commit order)
b5fbe2a, the flake fix.start_subscribersis false: the default is true (host_bookclubmix.exs), andconfig/runtime.exssets false only whenconfig_env() == :test.92d3404, PRJ.schema_contract_test: every query column is in the PRJ schema.ProjectBookclub.TestEnvfixture, like E'sproject_bookclub_test_env, withreckon_dbas a test-only dep.9d3e807, QRY.26c5573, a test fix. The default-env test reads host_bookclub's compiled.appfile, because the loaded spec already carries the test override.Closes gap rows: §F PRJ clubs, PRJ books/members/readings, QRY get_bookclub, QRY get_member/get_book; H.4.
Prod and dev are unchanged
Two tests show it. One reads
start_subscribers == truefrom the compiled.app. The other readsconfig/runtime.exsfor dev withConfig.Readerand finds no override. Prod differs from dev in runtime.exs only by requiringSECRET_KEY_BASE.Checks (msi00, CI image, at this tip
26c5573)--warnings-as-errors, credo--strict, dialyzer: all rc 0Mutants killed:
INSERT OR REPLACEchanged toINSERTin the clubs projection: "reapplying the same event changes nothing"Left alone: the QRY tests still create their own tables, because QRY has no dependency on PRJ.
For the reviewer: Uranus's note on PR 15 (checked here)
On PR 15 each fact was published twice under test: the application's supervisor started the three emitters, and the emitter suite started its own. This PR closes that.
config/runtime.exs:37-39setsstart_subscribers: falsein the test env alone, andHostBookclub.Supervisor.children(false)(supervisor.ex:48) then starts no subscriber, so only the suite's emitters publish. The mutant "the runtime.exs test override removed" is killed by "no subscriber runs in the test env". Please check this.The name of
emit_member_registered_v1_to_mesh_test.exsis kept on purpose, even though the suite covers three emitters. The Erlang twin's suite has the same name and the same scope (mcl-bookclubemit_member_registered_v1_to_mesh_tests.erl:114-116), and the alignment ruling says Erlang's shape wins.Landed by fast-forward: main is
26c557328c(from3d1bd83a), PASS r=1, CI 6217, 6222. This repository does not allow the manually-merged style, so the PR is closed by hand.Pull request closed