Skip to content

test(dispatch): e2e regression test for 5-stack + Rust dispatch (#550) - #553

Merged
Wolfvin merged 1 commit into
mainfrom
test/dispatch-e2e-550
Jun 28, 2026
Merged

test(dispatch): e2e regression test for 5-stack + Rust dispatch (#550)#553
Wolfvin merged 1 commit into
mainfrom
test/dispatch-e2e-550

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

PR #537 fixed a critical silent-no-op bug: 5 stacks (crystal, dart, fsharp, kotlin, zig) had no dispatch case in scripts/regret.js. The if-else chain had no else clause, so unmatched stacks exited 0 doing nothing. Existing tests called validate_<stack>.sh directly, bypassing the dispatch layer — the bug was invisible to CI.

This test ensures the bug class can never regress.

Test design — 4 groups, 20 tests total

Group Tests Runs when Purpose
1. Static source check 6 Always Asserts regret.js source contains stack === '<name>' + references to capture/validate scripts
2. Dispatch invocation 12 Always (no runtime needed) Builds temp fixture, runs regret.js, asserts stdout contains script name (proves dispatch fired)
3. Full E2E 12 Per-stack, only if runtime installed cd into proof project, run capture+validate, assert exit 0 + fresh .regret + PASS
4. Negative test 1 Always Uses unsupported stack name to reproduce exact PR #537 silent-no-op, proving Group 2 catches missing dispatch

Key design decision

Dispatch signal = regret.js's own run() helper which does console.log($ ${cmd} ${cmdArgs.join(' ')}) BEFORE spawning child. So stdout containing script name = definitive proof dispatch fired. Works regardless of whether runtime is installed.

Verification

  • node --test tests/dispatch-e2e.test.js → 20 tests, 20 pass, 0 fail, 0 skipped
  • Zero runtimes installed in dev env (rustc/crystal/dart/dotnet/kotlinc/zig all missing)
  • Group 3 skipped naturally; Groups 1, 2, 4 (the regression catchers) all pass

Cleanup

  • No .regret files modified (all E2E skipped)
  • Temp fixtures cleaned via try/finally rmSync
  • after() hook does git checkout for standard proof projects

Test plan

  • CI green
  • Reviewer confirms test catches regression (remove a dispatch case → test fails)

Closes #550

PR #537 fixed a critical silent-no-op bug: 5 stacks (crystal, dart,
fsharp, kotlin, zig) had no dispatch case in scripts/regret.js. The
if-else chain had no else clause, so unmatched stacks exited 0 doing
nothing. Existing tests called validate_<stack>.sh directly, bypassing
the dispatch layer — the bug was invisible to CI.

This test ensures the bug class can never regress. 4 test groups:

1. Static source check (6 tests, always run) — asserts regret.js
   source contains 'stack === <name>' + references to
   capture_<name>.sh and validate_<name>.sh for all 6 stacks.

2. Dispatch invocation (12 tests, always run) — builds temp fixture
   per stack, runs 'regret.js capture|validate', asserts stdout
   contains the script name (proves dispatch fired). Uses regret.js's
   own run() console.log as the dispatch signal — works regardless of
   whether the runtime is installed.

3. Full E2E (12 tests, per-stack skip if runtime missing) — cd into
   existing proof project, run capture+validate, assert exit 0 +
   fresh .regret + 'PASS' in output.

4. Negative test (1 test, always run) — uses unsupported stack name
   to reproduce the exact PR #537 silent-no-op (exit 0, no dispatch
   line), proving Group 2 would catch a removed dispatch case.

Result: 20 tests, all pass. Zero runtimes installed in dev env, so
Group 3 skipped — but Groups 1, 2, 4 (the regression catchers) all
run without any runtime dependency.

Cleanup: no .regret files modified (all E2E skipped). Temp fixtures
cleaned via try/finally rmSync. after() hook does git checkout for
standard proof projects; rmSync for dart's temp working copy.

Closes #550
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Wolfvin
Wolfvin merged commit fd206e0 into main Jun 28, 2026
6 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(regret.js): no end-to-end test for 5-stack + Rust dispatch (crystal/dart/fsharp/kotlin/zig/rust)

1 participant