Repository navigation
fix(e2e): canonicalize temp repo paths so golden tests pass on macOS - #6718
Conversation
The golden release E2E tests (golden-core-flows + the seeded terminal golden suite) fail deterministically on macOS with "Expected e2e repo to be loaded". Root cause is a test bug, not an app regression: - PR stablyai#6574 made repos:add store repo.path = getGitRepoRoot(path), which runs `git rev-parse --show-toplevel` and resolves symlinks. - On macOS os.tmpdir() returns /var/... which symlinks to /private/var/..., so the app stores the canonical /private/var/... path while the tests assert on the raw /var/... path via strict `=== repoPath` equality. - It passes on Linux CI (/tmp is not a symlink) but fails on the macOS golden job. Fix: wrap the temp-repo/parent creation in realpathSync at every site that later asserts on the store's canonicalized path. This mirrors the existing convention in combined-diff-scroll-restore.spec.ts and large-diff-repro-fixtures.ts. Covered sites: - golden-core-flows.spec.ts (createGitRepo) - global-setup.ts + helpers/orca-app.ts (seeded fixture used by the terminal golden suite and other specs) - add-project-default-checkout.spec.ts (linked/clone fixtures) - folder-setup.spec.ts + folder-setup-shallow-priority.spec.ts (group import path/parentPath assertions) Verified locally on macOS: golden-core-flows 5/5 clean runs, terminal golden 2/2, and all hardened specs pass individually.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAcross all e2e test fixture files, the 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
Summary
The golden release E2E tests fail deterministically on macOS with
Expected e2e repo to be loaded/repo did not load. This is a test bug, not an app regression — the app behavior is correct; the tests just assert on the wrong path form.Root cause
adcf74a9fb) maderepos:addstorerepo.path = getGitRepoRoot(path), which runsgit rev-parse --show-toplevel. That resolves symlinks.os.tmpdir()returns/var/folders/..., which is a symlink to/private/var/folders/.... So the app stores the canonical/private/var/...path, while the tests create the repo under/var/...and assert with strictcandidate.path === rawPathequality → never matches./tmpis not a symlink) but fails on the macOS golden job, which is why the release looked green on Linux but the golden gate failed.The
getGitRepoRootcanonicalization is intentional, correct production behavior (it fixes monorepo-subfolder imports, #6336/#6574). In production the native folder picker returns already-canonical paths, so users never hit this — it only surfaces because the tests useos.tmpdir(), which returns the/varsymlink.Fix
Wrap the temp-repo / parent-dir creation in
realpathSyncat every site that later asserts on the store's canonicalized path. This mirrors the existing convention already used incombined-diff-scroll-restore.spec.ts:51andlarge-diff-repro-fixtures.ts:23.Sites covered:
golden-core-flows.spec.ts(createGitRepo)repo.path === targetPathglobal-setup.ts+helpers/orca-app.ts(createSeededTestRepo)add-project-default-checkout.spec.tsrepo.path === mainPath(linked-worktree fixture)folder-setup.spec.tsprojectPaths.includes(repo.path)+group.parentPath === parentPathfolder-setup-shallow-priority.spec.tsrepo.path === webClientPath/apiPath/webPath+group.parentPath === parentPathThe last three were hardened proactively: they exercise the same canonicalize-on-import path and would exhibit the same latent macOS mismatch if run on the macOS job.
Verification (local, macOS)
golden-core-flows.spec.ts— 5/5 clean runs, 0 crashestest:e2e:terminal-rendering-golden— 2/2 passadd-project-default-checkout.spec.ts— 2/2 passfolder-setup.spec.ts— 2/2 passfolder-setup-shallow-priority.spec.ts— 2/2 passRoot cause + fix correctness independently confirmed by an adversarial review agent (high confidence).
Known follow-up (NOT addressed here, non-blocking)
During the original failing run, the app once hit a native
FATAL ERROR/SIGABRTin@parcel/watcher'sgetIgnoreGlobsduring teardown:Assessment (verified, high confidence): this is a latent abnormal-shutdown teardown race in the main-thread worktree-base watcher (
src/main/ipc/worktree-base-directory-watcher.ts— the only subscription using glob ignores, so the only one that reachesgetIgnoreGlobs). It fires only when the process begins freeing the Node environment with an inflight@parcel/watchersubscribe/unsubscribe still queued — i.e. when the app is torn down abnormally mid-watch (as happened when the repo-load assertion failed). It did not recur across 5 subsequent clean runs, because the normalwill-quitpath alreadypreventDefault()s and awaitsshutdownWatchersOnce()before exiting.It is not a user-facing regression and should not block the release. Suggested follow-up: harden the abnormal-exit path so an inflight glob-watch op can't fault during env teardown (e.g. a best-effort drain/guard equivalent to the worker watcher's). Happy to open a separate issue/PR for this.
🤖 Generated with Claude Code
Made with Orca 🐋