Skip to content

fix(test): isolate home state under CI quality gates#436

Merged
christso merged 1 commit into
mainfrom
fix/ci-authoritative-test-isolation
Jul 13, 2026
Merged

fix(test): isolate home state under CI quality gates#436
christso merged 1 commit into
mainfrom
fix/ci-authoritative-test-isolation

Conversation

@christso

Copy link
Copy Markdown
Contributor

Summary

Home-scoped tests no longer read or mutate real user state under Bun 1.3.13. A clearly owned ALLAGENTS_TEST_HOME override gives tests deterministic isolation even after Bun caches os.homedir(), while production continues to use the Windows-safe os.homedir() path from #434.

Broad quality checks now run authoritatively in GitHub Actions as separate Build, Typecheck, Lint, and Test jobs. The automatic prek pre-push installation and dependency are removed, and the permanently stale Bats command is replaced by a test:e2e script backed by the repository's nine tracked Bun E2E files.

Existing clones may retain a generated prek hook; contributors should inspect and remove only that generated hook if it still runs after updating.

Validation

Red reproductions before the fix:

bun -e "import { homedir } from 'node:os'; const before = homedir(); process.env.HOME = '/tmp/allagents-red-home'; process.env.USERPROFILE = '/tmp/allagents-red-home'; console.log(JSON.stringify({ before, after: homedir(), envHome: process.env.HOME })); if (homedir() === process.env.HOME) process.exit(1)"
bun test tests/unit/core/prune.test.ts

The first command showed after remained /home/entity; the prune suite failed its user-plugin case because it read the real home.

Green checks:

bun install --frozen-lockfile --ignore-scripts
bun run build
bun run typecheck
bun run lint
bun test tests/unit/constants.test.ts tests/unit/core/status-both-scopes.test.ts tests/unit/core/workspace-cache-seed.test.ts tests/unit/core/prune.test.ts
bun run test:e2e
bun run test
  • Focused regression group: 13 passed, 1 Windows-only test skipped
  • E2E suite: 116 passed, 4 network/auth-gated tests skipped
  • Full suite: 1,321 passed, 5 skipped

Built CLI E2E:

tmp_root=$(mktemp -d /tmp/allagents-ci-home-e2e.XXXXXX)
mkdir "$tmp_root/home"
ALLAGENTS_TEST_HOME="$tmp_root/home" ./dist/index.js workspace init "$tmp_root/workspace" --client claude
cd "$tmp_root/workspace"
ALLAGENTS_TEST_HOME="$tmp_root/home" /path/to/allagents/dist/index.js update
ALLAGENTS_TEST_HOME="$tmp_root/home" /path/to/allagents/dist/index.js plugin update
find "$tmp_root" -maxdepth 3 -type f -print
rm -rf "$tmp_root"

This created and updated an empty Claude workspace successfully, reported no plugins to update, and kept all generated home/workspace state under the temporary root.

Maintainer action

After this workflow lands, configure the Build, Typecheck, Lint, and Test checks as required checks for main branch protection.

Post-Deploy Monitoring & Validation

No application-runtime monitoring is required because this changes test isolation and repository quality gates. For the first pull request after merge, a maintainer should verify that all four CI jobs appear independently and complete successfully; missing jobs or unexpectedly green tests after a deliberate failure are rollback triggers for the workflow change.


Compound Engineering
Codex

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: d3ec4bb
Status: ✅  Deploy successful!
Preview URL: https://81ebefb3.allagents.pages.dev
Branch Preview URL: https://fix-ci-authoritative-test-is.allagents.pages.dev

View logs

@christso christso merged commit 174a599 into main Jul 13, 2026
5 checks passed
@christso christso deleted the fix/ci-authoritative-test-isolation branch July 13, 2026 03:29
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