Repository navigation
v1.93.31.0 test(cso): fixtureGit throws when git is killed or cannot start (#3476) - #3761
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ile already skips Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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.
What changed
fixtureGitused to treat a killed or missing Git as success. Now it throws and names the Git call.Before/after as text: fixtureGit: a killed or missing git used to count as success; now it throws and names the git call
Why
#3476 reported that
fixtureGitintest/cso-git-hardening.test.tsaccepts anullspawn status, so a killedgitlooks like success. That matters because the replaced-history hardening test sets up its condition withgit replace. If that one call were killed, the test would pass without the replacement ever being in place. The helper now fails at the Git step that broke. The stricter helper then caught a real case in CI: on Windows, the file's warm-up step had called/usr/bin/git(which doesn't exist there) on every run, and passed only because the ENOENT was swallowed.Blast radius
This is test-only.
fixtureGitis local totest/cso-git-hardening.test.tsand isn't exported. The otherfixtureGitfunctions intest/helpers/are separate functions that already checkresult.error || status !== 0. All 11 tests in the file aretest.skipIf(process.platform==='win32'), so skipping the warm-up on Windows removes nothing that ran. On Linux and macOS the warm-up runs as before, so the protection against a slow cold macOS runner stays. Evidence: Windows Free Tests run 41236157469 failed in the warm-up at the first commit, Linux runs 11 pass, and the fix-check read the touched hunks. Security read: no network calls, environment reads or permission changes.Approvals
Source: gstack-approvals record for gsta-217-fixturegit-status (display only; not an approval citation).
Summary
fixtureGitnow throws whenspawnSyncreports an error or any status other than 0, with the Git arguments, status and signal in the message. ThebeforeAllwarm-up returns early on Windows, where every test in the file already skips.Test Coverage
Coverage: skipped (no runtime file changed). The proof is the reproduction in the What changed section: the helper body from main, run with a 1 ms timeout, returns
""for a killed git (statusnull,ETIMEDOUT), and returns the same for a missing binary (ENOENT). The fixed helper throws in both cases. Windows Free Tests run 41236157469 is a second, unplanned proof: the stricter helper failed in the Windows warm-up, which the old helper had been hiding.Tests ran: cso 11
Tests ran: typecheck count unavailable
Pre-Landing Review
No issues found. In pass 1, my core review and a cross-family outside voice (openai/gpt-6.1-sol) found nothing. A second outside-voice run was voided and redone, because it had diffed against a stale local
main(it is in the decision trail). After the Windows fix, one fix-check read the touched hunks and found nothing.REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen fix_checks=1
Gate edits: none detected (GATE_SCAN tagged=0)
Outside review: clean (openai/gpt-6.1-sol)
Exploratory QA
Smoke:
bun test test/cso-git-hardening.test.tson Linux gave 11 pass, plus the killed-git and failing-git probes shown above. Windows behavior was checked by CI only.Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The approved plan is in the Approvals row above.
Issues
Fixes #3476
Verification Results
Remote pregate at tree bfbe271: 130 tests, 0 failed ($0.05). Free Tests run 41241286132: success.
TODOS
No TODO items completed in this PR.
Documentation
Status: current. The diff is test-only and no documentation changes are needed.
Scope: candidate
ship3476-docs2(base 2d1b55d to head a3e3228, branch gsta-217-fixturegit-status). Committed:test/cso-git-hardening.test.tsandchangelog.d/gsta-217-fixturegit-status.md. No staged, unstaged or new files. I searched the docs inventory for references to the changed helper and test file and found none in authored docs.Documentation health:
test/cso-git-hardening.test.ts: reviewed.fixtureGitnow throws on a spawn error or a non-zero or null status, and the beforeAll warm-up skips on win32, where every test already usesskipIf.changelog.d/gsta-217-fixturegit-status.md: reviewed, not edited (changelog metadata belongs to the parent). It is accurate against the diff.Coverage debt: none. The diff adds no public surface. Diagram drift: none.
Test plan
bun test test/cso-git-hardening.test.ts: 11 pass, 0 failbun run typecheck: cleangsta217): 130 tests, 0 failed