Skip to content

Commit a81d89a

Browse files
authored
docs(consumers): canonical CI is lint + unit tests; integration is bespoke (JRL-33) (#70)
JRL-32 phase 3 surfaced the question of how the canonical ci-python/ci-go/ci-node should handle infra-dependent tests (polars-hist-db's pytest opens MySQL connections). Decision: canonical runs lint + unit only; integration tests stay bespoke per repo with their own service setup. Pytest marker convention documented.
1 parent 659d8d2 commit a81d89a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ The canonical caller workflows encode invariants that are easy to break by hand
7474
- **Secret name match** — the reusable declares a secret name; the caller must pass it under exactly that name. `app_private_key` vs `INTEGRATION_APP_PRIVATE_KEY` is a one-character bug that fails the run at startup.
7575
- **Runner forwarding** — every reusable that runs jobs takes a `runner:` input parameterised via `vars.RUNNER_PROFILES[vars.RUNNER_PROFILE].default`. Hard-coded `ubuntu-latest` is forbidden.
7676

77+
## Tests: unit vs integration
78+
79+
The canonical `ci-python` / `ci-go` / `ci-node` callers run **lint + unit tests only**. Integration tests — anything that needs external infrastructure (database, message bus, S3, etc.) — stay **bespoke per repo** in a separate `integration-tests.yaml` workflow that owns its own service setup, fixtures, and secrets.
80+
81+
Why: each repo's external deps are different, so there's no canonical infra setup that fits every consumer. Pushing infra into the canonical CI would either reintroduce per-repo substitution (rejected — see "How a consuming repo uses this" above) or impose a one-size-fits-none stack on every Python/Go/Node repo.
82+
83+
How: canonical CI calls `pytest` (or `go test`, `vitest`) with the reusable's default flags. Each repo's test config (e.g. `pyproject.toml`'s `[tool.pytest.ini_options].addopts = "-m 'not integration'"`) excludes the integration subset from default collection. Tests carrying the marker (e.g. `@pytest.mark.integration`) only run when a bespoke workflow opts them in.
84+
85+
Repos with infra-dependent tests that can't (yet) be split: stay on a fully bespoke `ci.yaml` and omit the language group from `.shared-config.yaml`. Drift-check warns on the bespoke file (`stale-or-bespoke: ...`) but doesn't fail. Track adoption per repo under JRL-33.
86+
7787
## Lint configs
7888

7989
Separate from the workflow injection: `shared/sync.sh` syncs canonical lint configs (ruff.toml, eslint.config.mjs, .golangci.yml, etc.) into `.shared/` in consumer repos. That mechanism predates `consumers/` and is unrelated; see `shared/MANIFEST.json`.

0 commit comments

Comments
 (0)