Repository navigation
fix(ci): make release-green pre-flight gates visible + bounded (catch inherited unit reds) #5644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
diegosouzapw
merged 1 commit into
release/v3.8.43
from
fix/release-green-gate-visibility
Jun 30, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ const { | |
| parseCognitiveCount, | ||
| isDrift, | ||
| computeVerdict, | ||
| classifyRunError, | ||
| } = mod; | ||
|
|
||
| test("eslintCounts sums errors + warnings across files", () => { | ||
|
|
@@ -96,3 +97,27 @@ test("computeVerdict: full-coverage classification — ratchets are drift, defec | |
| assert.equal(withHardFail.releaseGreen, false); | ||
| assert.equal(withHardFail.hardFailures.length, 1); | ||
| }); | ||
|
|
||
| test("classifyRunError: a killed gate under a timeout surfaces as a visible non-zero failure (not an infinite hang)", () => { | ||
| // execFileSync kills the child on timeout → err.killed === true. The unit suite wedged on an | ||
| // unreleased SQLite handle must become a reported failure, never an infinite block that gets | ||
| // the pre-flight killed before it surfaces the unit reds (the v3.8.42 miss). | ||
| const r = classifyRunError({ killed: true, signal: "SIGTERM" }, 45 * 60 * 1000); | ||
| assert.equal(r.code, 124); | ||
| assert.match(r.out, /ceiling/); | ||
| assert.match(r.out, /hung\/failed gate/); | ||
| }); | ||
|
|
||
| test("classifyRunError: a normal non-zero exit keeps its status + combined output", () => { | ||
| const r = classifyRunError({ status: 1, stdout: "boom-out", stderr: "boom-err" }, undefined); | ||
| assert.equal(r.code, 1); | ||
| assert.equal(r.out, "boom-outboom-err"); | ||
| }); | ||
|
|
||
| test("classifyRunError: a kill WITHOUT a configured timeout is not misreported as a timeout", () => { | ||
| // No timeout set → a killed/odd error falls through to the generic branch (code 1), so we never | ||
| // claim a hang ceiling that was not actually configured. | ||
| const r = classifyRunError({ killed: true }, undefined); | ||
| assert.equal(r.code, 1); | ||
| assert.doesNotMatch(r.out, /ceiling/); | ||
| }); | ||
|
Comment on lines
+117
to
+123
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add test coverage for the new fallback behavior in test("classifyRunError: a kill WITHOUT a configured timeout is not misreported as a timeout", () => {
// No timeout set → a killed/odd error falls through to the generic branch (code 1), so we never
// claim a hang ceiling that was not actually configured.
const r = classifyRunError({ killed: true }, undefined);
assert.equal(r.code, 1);
assert.doesNotMatch(r.out, /ceiling/);
});
test("classifyRunError: falls back to err.message or string representation when stdout/stderr are empty", () => {
const spawnErr = new Error("spawnSync npx ENOENT");
const r = classifyRunError(spawnErr, undefined);
assert.equal(r.code, 1);
assert.equal(r.out, "spawnSync npx ENOENT");
const stringErr = "custom error string";
const r2 = classifyRunError(stringErr, undefined);
assert.equal(r2.code, 1);
assert.equal(r2.out, "custom error string");
}); |
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
execFileSyncfails to spawn the process (e.g., due toENOENTif a command or executable is missing), the thrown error object does not containstdoutorstderrproperties. Currently,classifyRunErroronly checkserr?.stdoutanderr?.stderr, which results in an empty string ("") foroutand discards the actual error message (e.g.,spawnSync npx ENOENT). Falling back toerr?.messageor a stringified representation of the error ensures that system/spawn errors are clearly surfaced in the failure details.