Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 3 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
strategy:
matrix:
node-version: [20.x]
# Note: Node 22.x excluded due to memory issues with worker-handler tests
# Can be re-enabled once Vitest/V8 memory handling improves


steps:
- uses: actions/checkout@v4

Expand All @@ -34,33 +32,9 @@ jobs:
- name: Build project
run: npm run build

- name: Run unit tests (core)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/core/

- name: Run unit tests (implementations)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/implementations/

- name: Run unit tests (query handler)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/services/handlers/query-handler.test.ts

# Worker handler test skipped in CI due to excessive memory requirements (>6GB)
# Run locally with: NODE_OPTIONS="--max-old-space-size=6144" npm run test:unit -- tests/unit/services/handlers/worker-handler.test.ts
# - name: Run unit tests (worker handler)
# run: NODE_OPTIONS="--max-old-space-size=6144" npm run test:unit -- --pool=forks --poolOptions.forks.singleFork tests/unit/services/handlers/worker-handler.test.ts
- name: Run tests
run: npm run test:all

- name: Run unit tests (adapters & utils)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/adapters/ tests/unit/utils/

- name: Run unit tests (error scenarios)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/error-scenarios/

- name: Run unit tests (root level)
run: NODE_OPTIONS="--max-old-space-size=2048" npm run test:unit -- tests/unit/*.test.ts

# Integration tests require Claude Code CLI to be installed
# Skip in CI since `claude` binary is not available
# Run locally with: npm test -- tests/integration/

- name: Test CLI commands
run: |
node dist/cli.js help
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ npm run test:coverage # With coverage

**Memory Management**:
- All commands use 2GB memory limit (`--max-old-space-size=2048`)
- Vitest config: `memoryLimit: '1024MB'` restarts workers at 1GB threshold
- Vitest config: `vmMemoryLimit: '1024MB'` restarts workers at 1GB threshold
- **Claude Code constraint**: Full suite exhausts system resources even with low limits


Expand Down Expand Up @@ -111,8 +111,8 @@ See `docs/TASK-DEPENDENCIES.md` for usage patterns.
- **Use individual groups** from Claude Code: `npm run test:core`, `test:handlers`, etc.
- **Full suite**: `npm run test:all` (only in local terminal/CI)
- **ROOT CAUSE of memory exhaustion**: Vitest workers accumulate memory across test files
- **Solution**: `memoryLimit: '1024MB'` in vitest.config.ts restarts workers at 1GB threshold
- **Tests are sequential** via vitest config (`singleThread: true`, `isolate: false`)
- **Solution**: `vmMemoryLimit: '1024MB'` in vitest.config.ts restarts workers at 1GB threshold
- **Tests are sequential** via vitest config (`maxWorkers: 1`, `isolate: false`)
- **All commands use 2GB** memory limit (`--max-old-space-size=2048`)
- **No real process spawning** - all tests use mocks (MockWorkerPool, MockProcessSpawner)

Expand Down
Loading