Skip to content

test(backend): run integration tests with nextest across parallel CI shards#13317

Draft
sbpublic wants to merge 3 commits into
mainfrom
test/backend/nextest-partition-it
Draft

test(backend): run integration tests with nextest across parallel CI shards#13317
sbpublic wants to merge 3 commits into
mainfrom
test/backend/nextest-partition-it

Conversation

@sbpublic

@sbpublic sbpublic commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Follow-up to #13273 (which fixed the backend tests OOM by running the it suite in sequential per-chunk processes) and @AntonioVentilii's review suggestion. Closes #13316.

cargo-nextest runs each test in its own process, so every integration test gets a fresh PocketIC server and its memory is released on process exit — memory never accumulates across the suite, so the hand-rolled chunking is no longer needed. Its --partition also shards the suite across parallel CI jobs, cutting wall-clock.

Changes

  • scripts/test.backend.sh: replaced the run_it_in_chunks bash workaround with cargo nextest run -p backend. On CI it passes --partition "$NEXTEST_PARTITION" (set by the matrix); explicit cargo args (e.g. the breaking-interface -- --ignored candid) and local runs keep the plain cargo test path.
  • .github/workflows/backend-tests.yml: the tests job now fans out into a 4-way partition matrix (fail-fast: false), installs cargo-nextest via the official get.nexte.st script, and sets NEXTEST_PARTITION=count:${matrix.partition}/4.
  • dev-tools.json: added cargo-nextest (cargo-binstall) for local scripts/setup.

Tests

  • Validated locally: nextest list discovers all 191 it tests, and --partition count:N/4 splits them 48/48/48/47; shellcheck/shfmt/bash -n clean, dev-tools.json valid JSON, workflow valid YAML.
  • The actual test run (wasm + PocketIC) can't run locally (no wasm clang) — the chunked→nextest behaviour is validated by this PR's own tests matrix on CI.

Notes


🤖 Generated with Claude Code — model: Claude Opus 4.8 (claude-opus-4-8)

sbpublic and others added 3 commits July 1, 2026 18:08
…shards

Replaces the sequential per-chunk workaround (#13273) with cargo-nextest.
nextest runs each test in its own process, so every integration test gets
a fresh PocketIC server and its memory is released on process exit —
memory never accumulates, no chunking needed.

The `tests` CI job now fans out into a 4-way matrix; each shard runs its
slice via nextest's `--partition count:N/4`, cutting wall-clock. Explicit
cargo args (e.g. the breaking-interface `-- --ignored candid`) and local
runs keep the plain `cargo test` path.

- dev-tools.json: add cargo-nextest (local `scripts/setup`); CI installs it
  via the official get.nexte.st script.

Closes #13316

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

Backend integration tests: adopt cargo-nextest + parallel CI shards

1 participant