GitNexus/gitnexus/test/unit
Gergő Magyar 1952c2c346
ci: add macOS to cross-platform test matrix (#208)
* ci: add macOS to cross-platform test matrix

* ci: run integration tests on all platforms, add macOS to matrix

* ci: add build step before cross-platform integration tests

Worker pool requires compiled parse-worker.js in dist/.
Without build, falls back to sequential parsing which times out
on macOS runners.

* fix(pipeline): resolve worker path to dist/ when running under vitest

import.meta.url points to src/ under vitest where no .js exists.
Fall back to dist/core/ingestion/workers/parse-worker.js so worker
threads spawn correctly on all platforms instead of sequential fallback
that times out on slower macOS CI runners.

* ci: split cross-platform unit and integration tests into parallel jobs

* test: add integration tests for worker pool and hooks e2e

- worker-pool.test.ts: 7 tests verifying dist/ worker spawning,
  multi-file parsing, progress reporting, and clean termination
- hooks-e2e.test.ts: 28 tests with real git repos testing staleness
  detection, embeddings flag, mutation regex, cwd validation,
  and .gitnexus directory discovery

* refactor: extract shared hook test helpers and simplify worker fallback

- Extract runHook/parseHookOutput into test/utils/hook-test-helpers.ts
- Deduplicate fileURLToPath calls in pipeline.ts worker resolution
- Add isDev logging for worker pool creation failures

* fix(test): accept timeout as valid outcome for PreToolUse CLI spawn

The Plugin hook spawns `gitnexus augment` which may hang on macOS
when the CLI is unavailable, causing a 10s timeout (status=null)
instead of a clean exit (status=0). Accept both as non-crash outcomes.
2026-03-07 10:38:32 +00:00
..
ai-context.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
ast-cache.test.ts fix: guard createASTCache against zero maxSize to prevent LRU cache crash 2026-03-02 08:47:20 +00:00
bm25-search.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
call-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
calltool-dispatch.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
cli-commands.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
cli-index-help.test.ts Improve MCP startup compatibility and lazy-load CLI commands (#207) 2026-03-07 07:47:09 +00:00
community-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
compatible-stdio-transport.test.ts Improve MCP startup compatibility and lazy-load CLI commands (#207) 2026-03-07 07:47:09 +00:00
csv-escaping.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
embedder.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
entry-point-scoring.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
eval-formatters.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
framework-detection.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
git.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
graph.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
heritage-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
hooks.test.ts ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00
hybrid-search.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
ignore-service.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
import-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
ingestion-utils.test.ts fix(test): update ingestion-utils test for Kotlin support 2026-03-01 23:18:21 +05:30
lazy-action.test.ts Improve MCP startup compatibility and lazy-load CLI commands (#207) 2026-03-07 07:47:09 +00:00
parser-loader.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
pipeline-exports.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
process-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
repo-manager.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
resources.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
schema.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
security.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
server.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
staleness.test.ts fix(test): use HEAD~1 instead of root commit in staleness test 2026-03-01 20:23:06 +05:30
structure-processor.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
symbol-table.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
tools.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
tree-sitter-queries.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30
utils.test.ts test: add test suite with vitest (unit + integration + fixtures) 2026-03-01 20:07:02 +05:30