Skip to content

fix(test): isolate Codex account storage#816

Open
Disaster-Terminator wants to merge 1 commit into
jlcodes99:mainfrom
Disaster-Terminator:fix/windows-codex-account-test-isolation
Open

fix(test): isolate Codex account storage#816
Disaster-Terminator wants to merge 1 commit into
jlcodes99:mainfrom
Disaster-Terminator:fix/windows-codex-account-test-isolation

Conversation

@Disaster-Terminator
Copy link
Copy Markdown
Contributor

Summary

  • Add a test-only data directory override for account storage in both the app crate and cockpit-core.
  • Wire Codex account test guards to use that isolated data directory.
  • Add regression coverage that asserts Codex account storage stays inside the test home.

Problem

Codex account tests create mock accounts such as demo@example.com, access@example.com, and auth-access@example.com. On Windows, overriding HOME and CODEX_HOME is not enough to make dirs::home_dir() resolve into the test directory, so tests can write those mock accounts into the real user data directory at .antigravity_cockpit/codex_accounts.json.

This keeps the production path unchanged and only enables the override for test builds.

Test Plan

  • cargo test -p cockpit-core --lib test_env_guard_redirects_codex_account_storage
  • cargo test -p cockpit-tools --lib test_env_guard_redirects_codex_account_storage
  • cargo test -p cockpit-core --lib upsert_
  • cargo test -p cockpit-tools --lib upsert_
  • cargo test -p cockpit-core --lib modules::codex_account::tests
  • cargo test -p cockpit-tools --lib modules::codex_account::tests
  • git diff --check

Note: cargo fmt --check currently reports pre-existing formatting drift in unrelated files outside this PR.

@Disaster-Terminator Disaster-Terminator marked this pull request as ready for review May 20, 2026 02:41
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