Skip to content

ci: merge test+coverage; add ci:db / ci:prover subset gates - #167

Merged
TaprootFreak merged 1 commit into
stagingfrom
ci/merge-test-coverage-and-add-subset-gates
Jun 1, 2026
Merged

ci: merge test+coverage; add ci:db / ci:prover subset gates#167
TaprootFreak merged 1 commit into
stagingfrom
ci/merge-test-coverage-and-add-subset-gates

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Summary

Two structural changes to the heavy CI lane. Test set is preserved bit-for-bit; the 100% line + function coverage gate stays as the authoritative pre-merge check.

1. Merge node-tests and coverage into a single test-and-coverage job

The previous topology ran the same -p node -p shared --all-features test set twice on the same self-hosted m3-ultra pool — once plain, once under cargo llvm-cov nextest. The instrumented run already produces test execution AND coverage data; the standalone node-tests job was pure duplication.

  • Same strictness: --fail-under-lines 100 --fail-under-functions 100.
  • Same ignore regex (main\.rs|lib\.rs|publisher\.rs|runtime\.rs|scanner_runtime\.rs|scanner_ws\.rs|flow\.rs|job_dispatcher\.rs|_tests\.rs$|bin/.*\.rs$) plus shared/src/.*\.rs$ so the coverage scope stays -p node while the executor runs both crates.
  • Same RUSTFLAGS=--cfg coverage_nightly, same env vars, same sccache 50 GiB cap, same -E 'not binary(api_remote)' exclusion.
  • One m3-ultra agent slot per PR instead of two → directly reduces the Colima / Postgres-container pressure that produced sporadic PoolTimedOut flakes when multiple PRs ran the heavy lane in parallel on dfx01.

2. Add ci:db and ci:prover subset gates

Two new lightweight jobs for faster developer iteration:

  • db-tests (ci:db) — Postgres-backed surface (db / state / job_store / audit / username / r2_probe / publisher / runtime / commitment / jobs-API router subset / build_network_config crate-root tests / persist+load account_node tests). Plain cargo nextest run, no llvm-cov. ~15 min.
  • prover-tests (ci:prover) — full account_node send / mint / receive surface (Plonky2 happy paths and pure-Rust error paths). ~25 min.

Both carry && !contains(... labels.*.name, 'ci:full') so a PR labeled with both runs only the heavy gate (superset). Both run on [self-hosted, m3-ultra] with the same env / sccache / DOCKER_HOST steps and a Telegram-alert step. ci:full remains the authoritative pre-merge gate.

Job topology after this PR

lint-and-build  (ubuntu-latest, always except draft)
       │
       ├──→ db-tests        (m3-ultra, label `ci:db`,    skips on `ci:full`)
       ├──→ prover-tests    (m3-ultra, label `ci:prover`, skips on `ci:full`)
       └──→ test-and-coverage  (m3-ultra, label `ci:full`)
                              │
                              └──→ notify-failure (Telegram)

Test plan

  • CI on this PR runs lint-and-build only (no labels applied → no heavy lane).
  • Apply ci:full label on this PR → test-and-coverage runs and the 100 % gate passes.
  • Apply ci:db label on a separate PR touching only DB code → db-tests runs, no coverage gate.
  • Apply ci:prover label on a PR touching account_node prove paths → prover-tests runs.
  • Apply ci:full + ci:db together on a PR → only test-and-coverage runs (subsets correctly skipped).
  • Release PR (develop → main, auto-labeled ci:full) still triggers the heavy gate.

Out of scope

  • Postgres TEMPLATE-clone refactor (would further cut wall-clock by ~10 min via shared container + per-test DB clone). Deferred — the user prefers strict per-test isolation guarantees today.
  • dfxai-host migration for runner pool. Separate workstream.

…set gates

Two structural changes to the heavy CI lane, each preserving 100%
coverage gate strictness and the existing test set.

1. Merge `node-tests` and `coverage` into a single `test-and-coverage`
   job. The previous topology ran the same `-p node -p shared
   --all-features` test set TWICE on the same self-hosted m3-ultra
   pool (once plain, once under `cargo llvm-cov nextest`). The
   instrumented run already produces the test execution AND the
   coverage data, so the standalone `node-tests` job was pure
   duplication. After the merge:

     * Heavy gate still runs `cargo llvm-cov nextest … --fail-under-lines
       100 --fail-under-functions 100` — same strictness, same ignore
       regex, same `-E 'not binary(api_remote)'` exclusion, same
       `RUSTFLAGS=--cfg coverage_nightly`.
     * Test set is `-p node -p shared --all-features` (matching the
       former `node-tests` scope); the coverage scope stays `-p node`
       via an additional `shared/src/.*\.rs$` entry in the ignore
       regex.
     * One m3-ultra agent slot is occupied per PR instead of two,
       directly reducing the Colima / Postgres-container pressure on
       dfx01 that produced sporadic `PoolTimedOut` flakes when
       multiple PRs ran the heavy lane in parallel.

2. Add two new subset-gate jobs for faster developer iteration:

     * `db-tests` — gated by the new `ci:db` label. Runs the
       Postgres-backed test surface (db / state / job_store / audit /
       username / r2_probe / publisher / runtime / commitment / the
       jobs-API router subset / the build_network_config crate-root
       tests / the persist+load account_node tests) under plain
       `cargo nextest run` without llvm-cov instrumentation. ~15 min.
     * `prover-tests` — gated by the new `ci:prover` label. Runs the
       full account_node send / mint / receive surface (Plonky2 happy
       paths and pure-Rust error paths) so anything touching
       account-node state transitions is covered. ~25 min.

   Both subsets carry an `&& !contains(... labels.*.name, 'ci:full')`
   guard so a PR labeled with both runs only the heavy gate (the
   superset). Both run on the same `[self-hosted, m3-ultra]` pool
   with the same env block, sccache config, DOCKER_HOST step, and
   Telegram-alert step as the heavy job. They are NOT a pre-merge
   gate; `ci:full` remains the authoritative check.

Job topology now:
  lint-and-build → db-tests / prover-tests / test-and-coverage
                 (parallel, all `needs: lint-and-build`)
                 → notify-failure (needs: lint-and-build + test-and-coverage)

All filter expressions consistently `^`-anchored to the module root
to disambiguate from `<other>::tests::<same-prefix>` collisions.
@TaprootFreak
TaprootFreak marked this pull request as ready for review June 1, 2026 20:40
@TaprootFreak
TaprootFreak merged commit 72192c6 into staging Jun 1, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant