diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ee3c97..f4677f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,14 +15,13 @@ # Run on demand via `make bench-qa-{quick,smoke}` (10s / 30s) or # full `make bench-qa` (full sweep). -# Pipeline DISABLED 2026-05-02. CI runners overlap with the bench -# infrastructure fox is using for QA-quality measurements; auto- -# triggered pipelines on every push contend for the same runner pool -# & risk skewing bench latencies. Re-enable by deleting this -# workflow.rules block (everything below stays valid). -workflow: - rules: - - when: never +# Pipeline RE-ENABLED 2026-05-09 with `test-ci` (skips wikipedia +# ingest tests; full suite still available locally via `make test`). +# Originally disabled 2026-05-02 because bench infrastructure +# overlapped with the runner pool; mitigation today is the +# `test-ci` scope cap + per-job parallelism cap +# (PYTEST_XDIST_AUTO_NUM_WORKERS=4) so CI doesn't crowd live bench +# work. stages: - test @@ -37,10 +36,15 @@ variables: PYTEST_XDIST_AUTO_NUM_WORKERS: "4" # ---------------------------------------------------------------------- -# Default test job — runs the full unit suite via `make test`, which -# already passes `-n auto` to pytest-xdist for parallelism. On the -# in-house runner this finishes in ~11s wall-clock (3.4× the serial -# cost) for the 641-test suite. +# Default test job — runs the CI-scoped suite via `make test-ci`, +# which is `make test` minus tests/crawler (network) and the +# wikipedia ingest tests (`test_wikipedia_old.py`, +# `test_wikipedia_xml.py`; their runtime path is exercised end-to-end +# by real ingest under `make ingest-*` so the synthetic fixtures +# duplicate coverage). pytest-xdist `-n auto` parallelism is capped +# by PYTEST_XDIST_AUTO_NUM_WORKERS so cgroup-limited containers +# don't oversubscribe the host. Local `make test` stays +# comprehensive for the dev loop. # ---------------------------------------------------------------------- test: stage: test @@ -62,10 +66,11 @@ test: - .venv/bin/pip install --upgrade pip wheel - .venv/bin/pip install -e '.[dev]' script: - # `make test` invokes `pytest -q --ignore=tests/crawler -n auto`. + # `make test-ci` invokes pytest with --ignore=tests/crawler + # plus --ignore on the two wikipedia ingest test files. # PYTEST_XDIST_AUTO_NUM_WORKERS env var caps the worker count on # the runner; locally `-n auto` uses the full machine. - - make test + - make test-ci artifacts: when: on_failure paths: diff --git a/Makefile b/Makefile index 98185c1..24dc43a 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ SEARCH_Q ?= computer ingest ingest-cur ingest-old ingest-xml ingest-xml-history \ ingest-xml-attached ingest-abstract \ ingest-self ingest-self-providence ingest-git ingest-hg \ - verify search stats test test-live docs docs-api docs-api-clean \ + verify search stats test test-ci test-live docs docs-api docs-api-clean \ chain-check chain-check-shards \ falsify burn burn-kindergarten inspect bootstrap-crawler test-crawler crawl-ingest \ recrawl-check bench-qa bootstrap-math clean clean-db clean-data help \ @@ -613,6 +613,20 @@ stats: bootstrap ## counts: documents, chunks, edges, audit chain test: bootstrap ## run pytest suite (excludes opt-in crawler tests) $(VENV)/bin/pytest -q --ignore=tests/crawler -n auto +# CI-scoped suite: same as `make test` but also drops the wikipedia +# ingest tests (`test_wikipedia_old.py`, `test_wikipedia_xml.py`). +# Wikipedia ingest is exercised end-to-end on real shards via +# `make ingest-cur` / `make ingest-xml`; running synthetic-fixture +# coverage on every CI push duplicates that surface for no signal +# the runtime path doesn't already provide. Local `make test` stays +# comprehensive — this target is for the gate, not the dev loop. +test-ci: bootstrap ## CI gate: full suite minus crawler + wikipedia ingest + $(VENV)/bin/pytest -q \ + --ignore=tests/crawler \ + --ignore=tests/test_wikipedia_old.py \ + --ignore=tests/test_wikipedia_xml.py \ + -n auto + # Crawler tests are off-by-default — they hit the network in many cases # and require the heavy [crawler] extras (aiohttp, bs4, lxml, etc.). # Bootstrap installs the extras into the existing venv idempotently.