Skip to content

test: strip every inherited CODEMAN_* var from the suite (split from #476) - #479

Merged
Ark0N merged 1 commit into
Ark0N:masterfrom
opticon454:chore/test-env-isolation
Sep 23, 2026
Merged

Ark0N merged 1 commit into
Ark0N:masterfrom
opticon454:chore/test-env-isolation

Conversation

@opticon454

Copy link
Copy Markdown
Contributor

Split out of #476 at @Ark0N's request: the test-environment isolation changes, on their own.

What changes

  • test/setup.ts strips every inherited CODEMAN_* variable before the suite runs, not only the named ones. It also deletes CODEMAN_CASES_PATH explicitly. A Docker Compose deployment sets that variable, and it bypasses the temp HOME, so route tests wrote into the deployment's real case root when the suite ran inside that container. The existing named deletes (and upstream's CLAUDE_CONFIG_DIR strip) stay as documentation.
  • test/test-env-isolation.test.ts pins both: CODEMAN_CASES_PATH joins STRIPPED_ENV_VARS, and a new case asserts that no CODEMAN_* key survives.
  • test/quick-start.test.ts moves from port 3099 to 3299 (unused anywhere else in the suite), which it needed when the suite ran inside the deployment container, and gives beforeAll a 30s timeout. test/respawn-test-plan.md's port table follows.

Verification

npx vitest run --config config/vitest.ci.config.ts test/test-env-isolation.test.ts test/quick-start.test.ts with CODEMAN_CASES_PATH=/tmp/x CODEMAN_FOO=1 exported: 2 files, 38 tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GuHtuPiHXdykq9T6rKQJ9n

…ff 3099

Split out of Ark0N#476. A Docker Compose deployment exports CODEMAN_CASES_PATH,
which bypasses the temp HOME, so route tests wrote into the real case root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GuHtuPiHXdykq9T6rKQJ9n
@Ark0N
Ark0N merged commit dd230b0 into Ark0N:master Sep 23, 2026
2 checks passed
@Ark0N

Ark0N commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Merged and shipped in 1.33.0 (https://github.com/Ark0N/Codeman/releases/tag/codeman@1.33.0). Thanks @opticon454 for splitting this out of #476 as asked. Stripping every CODEMAN_* variable rather than a named list is the right shape, and the CODEMAN_CASES_PATH case you found (route tests writing into a Compose deployment's real case root) is exactly the kind of leak the named list could never have caught.

@opticon454
opticon454 deleted the chore/test-env-isolation branch September 24, 2026 00:33
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.

2 participants