Skip to content

(tests): isolate CODEX_HOME in every test that runs a scan - #1164

Merged
devsuitup merged 3 commits into
mainfrom
fix/1150-tests-isolate-codex-home
Nov 21, 2026
Merged

devsuitup merged 3 commits into
mainfrom
fix/1150-tests-isolate-codex-home

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #1150

Tests that run the scan worker, populateCacheViaWorker or the Codex harness pass isolated the Claude projects directory but not CODEX_HOME, so on a machine with Codex history they read the developer's real ~/.codex (e.g. 17 !== 3 upserts in session-cache-cold-start-progress) and every commit touching session-cache.js failed the local hook.

  • test/fixtures/isolated-codex-home.cjs points CODEX_HOME at an empty temporary directory and restores the previous value (deleting it when it was unset).
  • Every scan-running test file uses it.
  • test/isolated-codex-home.test.js fails if a scan-running test file does not use the helper.

Test-only change: no changelog entry.

Tests that run the scan worker or the Codex harness pass read the real
~/.codex on a machine with Codex history; a shared helper points CODEX_HOME
at an empty temporary directory, and a guard test keeps new scan tests on it.
@devsuitup devsuitup added the no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived label Nov 21, 2026
Reconcile and projects-query tests read the real ~/.codex through the Codex
harness listing; they now use the helper, the guard recognises those entry
points, and nested helpers restore in reverse order.
@devsuitup
devsuitup merged commit 9bdc895 into main Nov 21, 2026
6 checks passed
@devsuitup
devsuitup deleted the fix/1150-tests-isolate-codex-home branch November 21, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(tests): scan tests read the real ~/.codex and fail on a machine with Codex history

1 participant