test: cover the mise en place end to end (audit B11) #66

Merged
abiwab merged 6 commits from test/audit-b11 into main 2026-09-30 18:43:17 +02:00
Owner

Audit B11, the four missing tests in one PR (one commit each):

  1. conformance: compileDir swallowed any exception; it now only skips a case whose golden is an error.json (today: err-011) and rethrows anything else. Checked: a case that throws without error.json now fails the suite.
  2. kitchen: a property test over 900 seeded random recipes (the audit's generator, ported) checks the schedule/mise en place invariants and determinism. Checked: against the pre-A1 metrics.ts it fails with exactly the audit's symptoms (idleTime -1, cost on a section with no step). Applying-scale parity (audit C1, a known pre-existing bug) is left as an it.todo.
  3. cli: the real CLI is spawned for view, export and print with --mise-en-place (space and = forms, bad value -> exit 1). print is only run on a bad value since it opens a browser on success. Checked: breaking the flag mapping makes 2 tests fail.
  4. language-server: the built server is driven over LSP (startup answer arriving late, setting change, edit pending in the debounce, unknown value).

Writing 4 found a real bug, fixed in its own commit: connection.onDidChangeConfiguration was registered at the end of onInitialized, after several awaits, so a settings change sent right after startup hit a connection with no handler and was dropped (open recipes kept the old schedule, and the database path was not reloaded, until the next change). The handler is now registered before the first await. The test failed before the fix and passes 3 runs in a row after it.

ci (1324 tests) and conformance 98/98 pass. The Forgejo workflow already has Node and a build before the tests, which the LSP test needs. No changeset: the affected setting is new in 1.4.0.

Audit B11, the four missing tests in one PR (one commit each): 1. conformance: `compileDir` swallowed any exception; it now only skips a case whose golden is an `error.json` (today: err-011) and rethrows anything else. Checked: a case that throws without `error.json` now fails the suite. 2. kitchen: a property test over 900 seeded random recipes (the audit's generator, ported) checks the schedule/mise en place invariants and determinism. Checked: against the pre-A1 `metrics.ts` it fails with exactly the audit's symptoms (`idleTime -1`, cost on a section with no step). Applying-scale parity (audit C1, a known pre-existing bug) is left as an `it.todo`. 3. cli: the real CLI is spawned for `view`, `export` and `print` with `--mise-en-place` (space and `=` forms, bad value -> exit 1). `print` is only run on a bad value since it opens a browser on success. Checked: breaking the flag mapping makes 2 tests fail. 4. language-server: the built server is driven over LSP (startup answer arriving late, setting change, edit pending in the debounce, unknown value). Writing 4 found a real bug, fixed in its own commit: `connection.onDidChangeConfiguration` was registered at the *end* of `onInitialized`, after several awaits, so a settings change sent right after startup hit a connection with no handler and was dropped (open recipes kept the old schedule, and the database path was not reloaded, until the next change). The handler is now registered before the first await. The test failed before the fix and passes 3 runs in a row after it. ci (1324 tests) and conformance 98/98 pass. The Forgejo workflow already has Node and a build before the tests, which the LSP test needs. No changeset: the affected setting is new in 1.4.0.
test(kitchen): give the property test a timeout that fits a CI runner
All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 2m35s
5ffc7f9b4c
abiwab merged commit 8bf84a396f into main 2026-09-30 18:43:17 +02:00
abiwab deleted branch test/audit-b11 2026-09-30 18:43:17 +02:00
Sign in to join this conversation.
No description provided.