fix: make the new-chain test guard fail CI instead of exiting 0 - #118
Merged
Conversation
The "at least one passing test" guard lived in a suite-level after() hook. A throwing hook is reported as a failed suite but leaves the failure count at 0, and Node >=22.22 (CI uses node-version: "22") derives its exit code from the counters — so the runner exited 0 and the job went green on a run where the guard had fired. Node 20.x and 22.5 still exit 1, which is why this went unnoticed. Moving the check into a real test registered after the per-chain loop makes it exit non-zero again, and makes it show up as a failing testcase in the junit report instead of disappearing from it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
manuelwedler
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "there needs to be at least one passing test" guard for new chains lived in a suite-level
after()hook intests/chain-tests.test.ts. When it throws, Node reports the suite as failed but leaves the failure count at0— and Node >= 22.22 (CI runsnode-version: "22") derives the process exit code from those counters. So the runner exited0and thetest-new-chainjob went green on a run where the guard had actually fired.Seen on #117, run 30430598954:
…and the step still succeeded.
Reproduced with a minimal test (one passing
it, one throwing suite-levelafter):A failing
before()hook or a genuinely failingit()still exits1, so this is specific toafter. Neither downstream safety net catches it: the junit XML has no failing<testcase>(a hook failure isn't one), andmikepenz/action-junit-reportruns withfail_on_failure: false.Change
Move the guard out of the hook into a real test registered after the per-chain loop, so
anyTestsPassis already settled when it runs. It now exits non-zero and appears as a failing testcase in the junit report / PR annotations.🤖 Generated with Claude Code