From 5087788f66646eef4ef0728cfd707434c40b4721 Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Wed, 28 Jan 2026 15:06:32 +0900 Subject: [PATCH] ci: split test execution to prevent mock.module pollution --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 348a2ce4..6f16fcb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,34 @@ jobs: env: BUN_INSTALL_ALLOW_SCRIPTS: "@ast-grep/napi" - - name: Run tests - run: bun test --max-concurrency 1 + - name: Run mock-heavy tests (isolated) + run: | + # These files use mock.module() which pollutes module cache + # Run them in separate processes to prevent cross-file contamination + bun test src/plugin-handlers + bun test src/hooks/atlas + bun test src/hooks/compaction-context-injector + bun test src/features/tmux-subagent + + - name: Run remaining tests + run: | + # Run all other tests (mock-heavy ones are re-run but that's acceptable) + bun test bin script src/cli src/config src/mcp src/index.test.ts \ + src/agents src/tools src/shared \ + src/hooks/anthropic-context-window-limit-recovery \ + src/hooks/claude-code-compatibility \ + src/hooks/context-injection \ + src/hooks/provider-toast \ + src/hooks/session-notification \ + src/hooks/sisyphus \ + src/hooks/todo-continuation-enforcer \ + src/features/background-agent \ + src/features/builtin-commands \ + src/features/builtin-skills \ + src/features/claude-code-session-state \ + src/features/hook-message-injector \ + src/features/opencode-skill-loader \ + src/features/skill-mcp-manager typecheck: runs-on: ubuntu-latest