Skip to content

fix(tests): isolate workstation-dependent fixtures - #42005

Closed
jiang3ye wants to merge 9 commits into
stablyai:mainfrom
jiang3ye:codex/test-runtime-portability
Closed

jiang3ye wants to merge 9 commits into
stablyai:mainfrom
jiang3ye:codex/test-runtime-portability

Conversation

@jiang3ye

@jiang3ye jiang3ye commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Local tests should use their own temporary files and explicit fixture inputs, rather than inherit Git signing, locale, shell and desktop state from the developer's machine.

What Changed

Canonicalize short run-temp paths, isolate signing configuration per worker, keep historical fixtures outside protected agent directories and permit only that canonical cache root in Vite. Select Node for hook-server WAL persistence and filesystem-permission contracts. Isolate browser/process/worktree fixtures, and make the two workflow shell snippets work with the macOS system Bash.

The alias regression now creates its symlink/junction fixture under a deliberately short canonical base, so long inherited TMPDIR values do not accidentally exercise the socket-path fallback instead of alias resolution.

Why

These failures were exposed by full local verification of #41598. They are independent of native plugin integration, so they are submitted separately as requested in that review. The changes are confined to test execution, fixtures and CI shell portability.

Linked Issue

Fixes #41805

Visual Proof

N/A — test/CI infrastructure only; no product UI or interaction changes.

Testing

Verified independently after merging latest main at bf09e6da4d067727813c5c71a459cd40426665e4 on macOS with Node 24, pnpm 12.14.0 and Bun 1.4.4, with ORCA_BACKGROUND_LAUNCH=1.

  • Complete canonical preflight passed: 26/26 checks, exit 0, at bf09e6da4d067727813c5c71a459cd40426665e4. Command: ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2 --timeout=90. Total 1683.9s; the complete natural unit step passed in 1683.4s. No shortened unit timeout, runtime override, selector change or new skip was used.
  • Read-only discovery with the installed Vitest public APIs confirmed that this natural related selection equals the entire configured root-unit inventory: 6,968 unique files/specifications, zero missing/extra (4,495 bun-shared, 1,014 node-runtime, 1,459 bun). The exact cache helper is both a changed root and a Vite config dependency, which admits the complete inventory. No tests were executed by this discovery comparison.
  • Restored the mobile package's generated assets with its canonical pnpm --dir mobile run postinstall. Root/mobile/cloud installations use their frozen lockfiles; cloud workspace packages are built.
  • Mobile owner rerun (pnpm test, explicit paths, --maxWorkers=2): 21 files / 73 cases passed (44.49s). This covers every reported failed owner (15 unique files, including the bundle verifier) and all changed mobile render tests. The mobile browser fixtures specify their viewport/state and run headlessly.
  • Infrastructure owner rerun (pnpm test, 139 explicit paths, --maxWorkers=2): 139 files / 918 cases passed, with 2 existing skips (256.58s). Scope: every changed non-mobile test; all hook-server tests admitted to Node; all cross-version-wire test files; both login-shell owners; the runtime construction owner that imports the changed removal fragment; relay-region correction; filesystem reclaim; source-routing/release-audit owners; retained-string coverage. The temp-directory owner includes all 3 cases, including the real subprocess alias check. The scope uses current upstream paths: two hook files removed by main are absent, the new identity-scaling owner is included, and the renamed source-control owner preserves main's removal of the real-shell test block.
  • macOS /bin/bash 3.2: both changed snippets passed syntax checks; the path classifier executed successfully against this branch. The release-audit extraction owner executes the action script through the same system Bash.
  • The earlier asset-related failures were resolved through the canonical mobile generation step above; the earlier bounded preflight is superseded by this complete passing run. The explicit owner results remain supporting evidence.
Reproduce the passing scopes

The two directory filters in the second command expand to the same current test owners passed explicitly in the recorded local run.

ORCA_BACKGROUND_LAUNCH=1 pnpm test \
  config/scripts/build/mobile-web-app/build-mobile-web-app-bundle.test.mjs \
  config/scripts/mobile-web-app/preview/mobile-web-app-html-file-preview-render.test.mjs \
  config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs \
  config/scripts/mobile-web-app/preview/mobile-web-app-media-preview-render.test.mjs \
  config/scripts/mobile-web-app/preview/mobile-web-app-svg-preview-render.test.mjs \
  config/scripts/mobile-web-app/session/mobile-web-app-mermaid-render.test.mjs \
  config/scripts/mobile-web-app/session/mobile-web-app-native-chat-touch-scroll-render.test.mjs \
  config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs \
  config/scripts/mobile-web-app/session/mobile-web-app-session-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-browser-pane-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-drawer-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-handoff-grants-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-open-target-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-render.test.mjs \
  config/scripts/mobile-web-app/shell/mobile-web-app-safe-area-render.test.mjs \
  config/scripts/mobile-web-app/terminal/mobile-web-app-session-terminal-init.test.mjs \
  config/scripts/mobile-web-app/terminal/mobile-web-app-terminal-font-render.test.mjs \
  config/scripts/mobile-web-app/terminal/mobile-web-app-terminal-render.test.mjs \
  config/scripts/mobile-web-app/workspace/mobile-web-app-files-render.test.mjs \
  --maxWorkers=2

ORCA_BACKGROUND_LAUNCH=1 pnpm test \
  config/scripts/dependency-security/audit-tools/dependency-security-release.test.mjs \
  config/scripts/development/launch/run-electron-vite-dev.test.ts \
  config/scripts/runtime-verification/managed-account/managed-data-account-runtime.test.ts \
  config/scripts/test-runtime/environment/vitest-git-signing-env.test.mjs \
  config/scripts/test-runtime/execution-policy/vitest-run-temp-directory.test.mjs \
  config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts \
  config/scripts/workflow/source-routing/pr-code-change-scope.test.mjs \
  config/scripts/worktree-storage/reclaim-worktree-generated-files.test.mjs \
  src/main/codex-cli/command-guest-path.test.ts \
  src/main/ipc/worktree-symlink-reconciliation.real.test.ts \
  src/main/ipc/wsl-guest-native-program.test.ts \
  src/main/runtime/agent-session/environment/structured-session-cli-login-shell.live-shell.test.ts \
  src/main/runtime/agent-session/environment/structured-session-cli-login-shell.test.ts \
  src/main/runtime/construction/orca-runtime.test.ts \
  src/main/text-generation/prompts/source-control-wsl-prompt.test.ts \
  src/shared/own-retained-string.test.ts \
  tests/e2e/relay-region-correction.unit.test.ts \
  src/main/agent-hooks/server/testing \
  tests/e2e/cross-version-wire \
  --maxWorkers=2

No new skips or selection exclusions are added. Windows junction behavior and native Windows/Linux execution are not claimed as local live checks. No rendered Orca/Electron UI acceptance run is claimed for this infrastructure-only change. The complete canonical preflight after asset generation passed as recorded above. Successful preflight output does not retain unit case/skip totals, so those totals are not inferred from the scoped counts.

Risk

Level: Low.

Test discovery, Node/Bun admission and cache placement could affect local execution or test latency. Temporary caches use owned markers and existing write guards; the Vite allowance is limited to the exact canonical fixture root. A plain revert restores prior fixture behavior without changing user data.

AI Disclosure

OpenAI Codex assisted with implementation and verification.

Review

The new hook-server subtree glob includes the four individually listed owners it replaces; no test file or case is removed by that admission change. Retained-string coverage remains explicitly listed. Cross-platform paths/process wrappers, remote fixture inputs and protected-directory guards remain intact. The diff contains no credentials or user profile data; runtime/platform process wrappers remain in place.

Agent skill upstream boundary

  • No upstream skill-installer source, tests, fixtures or registries are copied.

Checklist

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes update workflow shell argument handling, move test scratch directories and selected fixtures to system temporary paths, and adjust test runtime configuration. They also add canonical-path handling for run-temp directories and create a shared cache setup for cross-version fixtures.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to bf09e

This PR only changes test and CI fixtures so they no longer depend on workstation state. No production behavior changes are indicated. The author reports that a fresh full-suite run remains for CI, which is normal pre-merge validation.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Linked issue #41805 has no contextual or closed-state exclusion. It is open and directly linked, so its coding requirements apply. The change summary shows implementation for most requirements: (1) sh… Provide the diff hunks (or the test file paths) for the hook-server and related test files where EPIPE observation and cleanup-call-count assertions were removed, against merge base 8c9aff2 and head bf09e6d…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title "fix(tests): isolate workstation-dependent fixtures" matches the main change. The PR moves test temp files, Git signing config, caches, and fixtures away from developer machine state, and it…
Out of Scope Changes check Passed All listed changes concern test execution, test fixtures, Vitest configuration, Node/Bun admission, and workflow shell portability. Each maps to an objective of #41805. The Vitest config change adds o…
Description check Passed The description follows the repository template and fills in most sections. It has an ELI5, a What Changed section that lists the scope, a Why section that explains the origin of the work, a linked is…
Full details: Title check

Explanation

The title "fix(tests): isolate workstation-dependent fixtures" matches the main change. The PR moves test temp files, Git signing config, caches, and fixtures away from developer machine state, and it also includes CI shell portability changes. The title covers the primary theme but not the workflow shell fixes, which is acceptable.

Full details: Out of Scope Changes check

Explanation

All listed changes concern test execution, test fixtures, Vitest configuration, Node/Bun admission, and workflow shell portability. Each maps to an objective of #41805. The Vitest config change adds only the workspace root and the canonical cross-version fixture cache root to server.fs.allow. The workflow edits replace mapfile and Bash arrays with POSIX positional parameters. The PR does not touch plugin settings, workspace APIs, or Agent handoff, which the issue excludes. No unrelated production behavior change appears in the summary. The changes to src/main/runtime/agent-session harness and the worktree-removal spec are test-only fixture isolation.

Full details: Description check

Explanation

The description follows the repository template and fills in most sections. It has an ELI5, a What Changed section that lists the scope, a Why section that explains the origin of the work, a linked issue (Fixes #41805), a Testing section with concrete commands and results, a Risk section with a Low level and a rollback note, an AI Disclosure, the upstream boundary checkbox, and a checklist. The Visual Proof section uses N/A with a reason, which the template allows for infrastructure-only changes. Gaps: the Why section does not compare the chosen approach with alternatives, as the template asks. The Testing section also reports that the final unit step timed out in one run and that a fresh full root-suite pass is still pending for CI. Also, the What Changed section is dense and does not describe the before and after behavior for each area. The 'Review' section mentions a hook-server subtree glob but does not explain the trade-off. These gaps are minor and do not block the check.

Full details: Linked Issues check

Explanation

Linked issue #41805 has no contextual or closed-state exclusion. It is open and directly linked, so its coding requirements apply. The change summary shows implementation for most requirements: (1) short canonical temp paths and alias fixture in vitest-run-temp-directory.mjs and its test; (2) unsigned fixture commits with per-worker random private Git config directory in vitest-git-signing-env.mjs; (3) Node admission for hook-server testing files in vitest-node-runtime-files.mjs; (4) cross-version fixture cache outside the protected directory with a narrow Vite server.fs.allow entry in config/vitest.config.ts and cross-version-fixture-cache.ts; (5) explicit tmpdir scratch paths and en-US locale in mobile render tests, and explicit platform in command-guest-path and wsl tests; (6) while-read positional parameters instead of mapfile in the workflow snippets. One requirement is not evidenced in the reviewed material. The issue asks to remove implementation-dependent EPIPE observation and cleanup-call-count assertions while keeping functional assertions. The summary states only that failure assertions are unchanged in vitest-node-runtime-pool.test.ts. I did not find the hunks that remove EPIPE or cleanup-count assertions in the hook-server tests. The file listing at head does not show diff content. The absence of these hunks in the summary is not proof that they are missing.

Resolution

Provide the diff hunks (or the test file paths) for the hook-server and related test files where EPIPE observation and cleanup-call-count assertions were removed, against merge base 8c9aff2 and head bf09e6d. Confirm that the functional success and failure assertions remain. Without that evidence, this assessment cannot be confirmed.

  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 619b80bc-c5ce-41ef-8248-785f654c6244
Commits

Reviewing files that changed from the base of the PR and between 59b88a1 and bf09e6d.

Files selected for processing: 27

  • .github/actions/prepare-dependency-audit/action.yml
  • .github/workflows/pr.yml
  • config/scripts/development/launch/run-electron-vite-dev.test.ts
  • config/scripts/mobile-web-app/preview/mobile-web-app-html-file-preview-render.test.mjs
  • config/scripts/mobile-web-app/preview/mobile-web-app-html-preview-render.test.mjs
  • config/scripts/mobile-web-app/session/mobile-web-app-mermaid-render.test.mjs
  • config/scripts/mobile-web-app/session/mobile-web-app-native-chat-touch-scroll-render.test.mjs
  • config/scripts/mobile-web-app/session/mobile-web-app-rich-markdown-render.test.mjs
  • config/scripts/mobile-web-app/shell/mobile-web-app-browser-pane-render.test.mjs
  • config/scripts/mobile-web-app/shell/mobile-web-app-composer-sizing-render.test.mjs
  • config/scripts/mobile-web-app/shell/mobile-web-app-native-parity-render.test.mjs
  • config/scripts/runtime-verification/managed-account/managed-data-account-runtime.test.ts
  • config/scripts/test-runtime/environment/vitest-git-signing-env.mjs
  • config/scripts/test-runtime/environment/vitest-git-signing-env.test.mjs
  • config/scripts/test-runtime/execution-policy/vitest-run-temp-directory.mjs
  • config/scripts/test-runtime/execution-policy/vitest-run-temp-directory.test.mjs
  • config/scripts/test-runtime/node-worker/vitest-node-runtime-pool.test.ts
  • config/scripts/test-runtime/sqlite-admission/vitest-node-runtime-files.mjs
  • config/vitest.config.ts
  • src/main/codex-cli/command-guest-path.test.ts
  • src/main/ipc/worktree-symlink-reconciliation.real.test.ts
  • src/main/ipc/wsl-guest-native-program.test.ts
  • src/main/runtime/agent-session/environment/structured-session-login-shell-test-harness.ts
  • src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts
  • tests/e2e/cross-version-wire/cross-version-fixture-cache.ts
  • tests/e2e/cross-version-wire/release-checkout.ts
  • tests/e2e/helpers/relay-execution-process.ts

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

@jiang3ye

Copy link
Copy Markdown
Contributor Author

Updated #41805 to match the final scope. Upstream #41947 (7f43d8aab63681c2ae6dccf9e5707e79e5a62971) already deleted the legacy real-shell EPIPE/cleanup-count block. This branch preserves that deletion: src/main/text-generation/prompts/source-control-wsl-prompt.test.ts has the same blob (67538be68c0c88283cdaa42d420a551383322a9c) in base 8c9aff20a3 and head bf09e6da4d. There is no source-control test delta in this PR. The hook-server subtree admission includes the four redundant individual entries it replaces; retained-string admission remains explicitly present.

@jiang3ye

Copy link
Copy Markdown
Contributor Author

Completed the previously outstanding full preflight at bf09e6da4d067727813c5c71a459cd40426665e4: ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed --maxWorkers=2 --timeout=90 exited 0, 26/26 checks passed, including the complete natural unit step (1683.4s; 1683.9s total). The PR description now supersedes the earlier bounded-run limitation. No selection/runtime overrides or new skips were used. The prerequisite mobile assets were generated using the package postinstall before this run.

@AmethystLiang

Copy link
Copy Markdown
Contributor

Thanks for this. We landed the tests-only fix in #47538 (credited to you as co-author), so closing this one.

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.

Isolate local test runtime and workflow portability from workstation state

2 participants