Skip to content

test: restore worktree Git spies after each case - #29558

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/test-audit-git-spy-cleanup
Oct 16, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/test-audit-git-spy-cleanup

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Stop three worktree tests from leaving a fake Git runner installed for later tests.

What Changed

Register per-test restoration immediately after creating each of three Git spies. The two runtime clone regressions keep their real Git configuration, origin checks and assertions. No product code or test cases are removed.

Why

Under shuffled order, an earlier empty-output Git spy made a newly written submodule file appear empty and prevented a completed clone's origin from being verified. Both failures reproduce on the unchanged parent. Restoring the spies at the producing tests fixes isolation without weakening clone behavior or resetting every shared fixture globally. Per-test completion callbacks run even when an assertion throws.

Linked Issue

Maintainer-requested CI test audit.

Visual Proof

N/A — test-fixture cleanup only; no rendered behavior changes.

Testing

  • I manually tested these changes locally
  • Automated tests updated

Linux, background launch, Node24.21.0/Bun1.4.3, one worker. Same seven-suite shuffle104729: parent1554pass/2fail/1skip; repaired1556pass/0fail/1skip. The exact two clone assertions now pass; every existing case remains. Full runtime normal order passes1385cases with the same single skip. Node typecheck, changed quality, lint, formatting and whitespace pass.

Diagnostic local seven-suite command wall: parent33.084s, candidate37.540s (candidate overlapped static checks). This is an isolation repair; these unpaired, differently contended observations establish no speedup. Exact-head full CI and hosted cost will be recorded before merge.

Review

Independent diagnosis traces both failures to un-restored empty-output spies. Independent preservation review approved exact commit f4207cb; every test declaration and assertion is preserved. Production0lines; tests+14/-5 after formatting. Host, SSH, folder-workspace, wire and Git compatibility behavior unchanged.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Focused change; mechanism, user impact and rationale explained
  • N/A visual proof explained
  • Cross-platform/SSH/folder behavior considered
  • Normal order and independent final review
  • Exact-head full workflow, separate checks and hosted measurement

Refreshed on main2e97d9aa84 after the independent focus-read repair (#29565). Exact reviewed two-file spy cleanup is unchanged. Fresh final-main shuffled runtime run passes1385cases with the same1skip. Prior seven-suite baseline/candidate controls remain valid because all involved runtime and spy fixture sources are unchanged by the ownership repair. Exact-head full CI and hosted measurement remain required.

Final CI: exactc360c0dd5d full .github/workflows/pr.yml run38878934970 passes aggregate116904066371, all five units, static/typecheck, relay and selection evidence. Current separate checks pass or intentionally skip, including Headless persistence. Actual checkout001d9b1a has exactly the reviewed head tree; baseline549ea6c2 equals main2e97 tree. Five clean report inventories retain exactly12334files and all pass/skip states, zero omissions/errors. Runtime retains1386tests/1skip. Selected module cost24104→25208ms (+4.58%) and summed worker work5951743→6141186ms (+3.18%); no hosted speedup claim. Both use matched LinuxX64/cache/four-worker setup (Node setup/artifact24.19.0, runtime wrapper verification24.21.0, Bun1.4.3). This change earns its value by fixing demonstrated order-dependent false failures.

@OrcaWin
OrcaWin marked this pull request as ready for review October 16, 2026 09:13
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 97be656f-f25f-4664-a75b-5e7465cee119
📥 Commits

Reviewing files that changed from the base of the PR and between 2e97d9a and c360c0d.

📒 Files selected for processing: 2
  • src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts
  • src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Three runtime tests now retain their Git spies and register restoration with Vitest’s onTestFinished callback. The changes cover branch-name override, missing or non-repository worktree cleanup, and orphan-removal scan-cache invalidation tests.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to c360c

This test-only change restores each Git spy after its case, preventing order-dependent interference. No code-specific merge risk is evident; exact-head full CI is still outstanding.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: restoring Git spies after each test case.
Description check Passed The description covers the change, reason, testing, visual proof, review, compatibility considerations, and checklist. The Linked Issue section does not contain an actual issue reference, but the rest…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Full details: Description check

Explanation

The description covers the change, reason, testing, visual proof, review, compatibility considerations, and checklist. The Linked Issue section does not contain an actual issue reference, but the rest of the description is substantially complete.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit e3f42d7 into main Oct 16, 2026
55 checks passed
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.

1 participant