fix(tests): bundle lane A — test hygiene, desktop restart guard and README inventory counts - #5672
Conversation
Carries #5482. Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
…s them Carries #5607. Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5570 (both PR commits, including the CodeRabbit ordering fix). Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5605. Folded review fix: each file restores only the module snapshots it actually captured, so a beforeAll that failed partway cannot install an empty module, and z-handler-activation restores its overrides in a finally block so a failed directory removal cannot leave them installed for later files in the process. Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5630. restartCodexDesktopApp returns the skipped reason test_environment when the test preload armed OCX_TEST_HOME_GUARD and no execFile was injected, and the CLI reports that skip. Folded review fix: structure/runtime.md documents the guarded outcome next to the CLI restart scope it owns. Co-authored-by: terin <100397903+sh940701@users.noreply.github.com>
… them Carries #5340, rebuilt on dev after #5615 and #5638 so their README and locale prose stays intact. Folded review fixes: dev now registers 14 retained stores, and native_control_replay is pinned (evictOldest returns 0), so every page says 14 and names the one store the budget never evicts; the guard's header drops the numbers that had gone stale; readme/i18n-manifest.json carries the hash of the final README.md. Co-authored-by: codingbo <9621077+codingbooo@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (55)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
리뷰 · 우선순위 63 / 80이 묶음은 세 가지를 고칩니다. 테스트가 옆 테스트를 망치지 않게 하고, 테스트를 돌릴 때 개발자 컴퓨터의 진짜 Codex 앱이 꺼졌다 켜지지 않게 하며, README에 적힌 메모리 개수를 코드와 같게 맞춥니다. 기준 브랜치는 한 프로세스에서 테스트 파일을 여러 개 돌리면 이런 일이 났습니다. 앞 파일이 모듈을 가짜로 바꾸면 뒷 파일이 그 가짜를 봅니다. 홈 폴더 변수를 지워 버리면 뒷 파일이 진짜 홈을 건드릴 수 있습니다. 번역에 쓰는 예산은, 이 도우미를 맨 처음 불러온 파일에서만 치워졌습니다. 각각 그 자리를 고쳤습니다. 데스크톱 재시작은 테스트가 가짜 실행기를 넣지 않았고 README는 "36종류"라는 합계를 뺐습니다. 그 합계를 계산해 줄 코드가 없기 때문입니다. 유지 저장소 14개, 관찰 버퍼 4개, 상태 저장소 등록 28개로 적습니다. 14개 가운데
메인테이너의 판단이 필요한 지점 이 PR이 대체한다고 적은 #5482, #5607, #5570, #5605, #5630, #5340은 아직 열려 있습니다. 둘 다 머지하면 같은 수정이 두 번 들어옵니다. 로컬에서 전체 테스트는 돌리지 않았습니다. 작성자는 이 헤드에서 타입체크, 구조 검사, 관련 파일만 돌렸다고 적었습니다. 대시보드가 데스크톱 재시작을 건너뛴 이유를 성공처럼 보여주는 문제는 작성자가 이번 묶음 밖으로 빼 두었습니다. 그 가드는 테스트 프로세스에서만 켜지므로, 이번 diff가 넓힌 구멍은 아닙니다. 너의 추천 호스트 CI가 헤드 이 댓글은 grok-bot이 작성했습니다 |
Summary
Bundle lane A of the 260923 PR-consolidation round: six test-hygiene and README-accuracy fixes carried onto current
dev, one commit per carried PR, each with the original author'sCo-authored-bytrailer.mock.modulewrappers capturedresolveAdapterthrough the live namespace binding, so a second file mockingadapter-resolvein the same process could make the fallback call itself. The real function is now captured before the override.afterEachonly fired for the first file that imported it in a shared process; budgets are now disposed per test withonTestFinished, keeping theafterEachfor budgets created outside a test.OPENCODEX_HOMEnow restore the value they inherited, so later files keep the preload's sandbox home instead of tripping the real-home guard.mock.moduleoverrides. Folded review fix: each file restores only snapshots it actually captured (abeforeAllthat failed partway can no longer install an empty module), andz-handler-activationrestores infinallyso a failed directory removal cannot leave its overrides installed.restartCodexDesktopAppreturns the skipped reasontest_environmentwhen the test preload armedOCX_TEST_HOME_GUARD=1and noexecFilewas injected, so a test can no longer quit and relaunch the developer's real Codex app; the CLI reports the skip. Folded review fix:structure/runtime.mddocuments the guarded outcome.tests/ci-workflows/docs-readme-memory-inventory.test.tsacross all eight pages. Rebuilt ondevafter docs: fix stale docs links, check them at build time, and bring the desktop guides and locales current #5615 and docs: put desktop downloads first in the README and on the landing page #5638 with their prose intact. Folded review fixes:devnow registers 14 retained stores, andnative_control_replayis pinned (evictOldestreturns 0), so every page states 14 and names the one store the budget never evicts;readme/i18n-manifest.jsoncarries the hash of the finalREADME.md.Supersedes #5482
Supersedes #5607
Supersedes #5570
Supersedes #5605
Supersedes #5630
Supersedes #5340
Refs #5439 — its first half (the batched runner cannot run on macOS: GNU
timeout,mapfile) was already fixed ondevby #5456. Its second half (failure counts that depend on batch size) comes from the cross-file leaks that #5570, #5605 and #5607 fix here;tests/server/config.test.tsalready restores its cwd, and the single-owner spend-ledger errors are the intended owned-spend-home contract.Credit:
Co-authored-by: Fred Amartey 43480311+FredAmartey@users.noreply.github.com
Co-authored-by: terin 100397903+sh940701@users.noreply.github.com
Co-authored-by: codingbo 9621077+codingbooo@users.noreply.github.com
Follow-up noted during review, not changed here:
gui/src/use-codex-restart.tsignoresdesktopApp.reasonfor every desktop skip reason ondev(unsupported platform, no targets, restart in flight, ...), so a skipped desktop restart with no running app-server reads as success.test_environmentonly occurs in armed test processes, so this bundle does not widen that gap.Verification
The full local suite was not run: the round's owner runs
bun run testonce after every lane has landed. Focused runs on the lane head, all in one Bun process per line:bun run typecheck— passbun run structure:check— pass;bun run privacy:scan— pass;git diff --check origin/dev..HEAD— cleanbun test tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/repo-hygiene.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts— 42 pass, 0 failbun test tests/ci-workflows/docs-readme-memory-inventory.test.ts tests/ci-workflows/docs-readme-translation-parity.test.ts tests/ci-workflows/docs-link-targets.test.ts— 93 pass, 0 failbun test tests/images— 217 pass, 0 fail (12 files in one process)bun test tests/adapters/abort-race.test.ts tests/adapters/anthropic/anthropic-quota-dispatch.test.ts tests/claude-integration/claude-code-thought-signature-scope.test.ts tests/routing/routing-policy-surface-parity.test.ts— 28 pass, 0 failbun test tests/images/gemini-inline.test.ts tests/images/loop.test.ts— 82 pass, 0 failbun test tests/clients/desktop-app-restart.test.ts tests/clients/desktop-app-restart-posix.test.ts tests/clients/desktop-restart-handoff.test.ts tests/ci-workflows/test-home-guard.test.ts— 83 pass, 0 failservice-secrets→winsw→service-tier-capabilityin one process — 710 pass, 6 fail. The six aretests/codex-integration/issue-914-transport-attribution.test.ts, which fails 6/6 identically atorigin/devin this checkout because the worktree lives under~/.codexand the file's temp directory trips the real-Codex-home guard; hosted CI checks out elsewhere.Each candidate got a read-only gpt-6-sol soundness review before carrying, and the final branch got a gpt-6-sol adversarial review: one P2 (dashboard ignores the new skip reason) was withdrawn after the evidence above, one P3 (devlog EOF blank lines) was fixed. Exact-head hosted CI is the remaining gate.
Checklist
Summary by CodeRabbit
Bug Fixes
Documentation