Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# cargo-nextest configuration (https://nexte.st/docs/configuration/).
#
# nextest runs every test in its own process, so a test that hangs or swaps
# cannot stall the rest of the binary, and the per-test timeouts below turn a
# stuck test into a failure instead of a job-level timeout. Doctests are not
# supported by nextest and still run through `cargo test --doc`.

[profile.default]
# Report tests that run longer than this; `terminate-after` multiplies it into
# a hard per-test limit.
slow-timeout = { period = "60s" }

# Used by CI (`--profile ci`).
[profile.ci]
fail-fast = false
failure-output = "immediate-final"
slow-timeout = { period = "60s", terminate-after = 15 }

# Tests that build a full-size production circuit peak at ~12 GB each; never
# run two at once. They are #[ignore]d and only selected with --run-ignored.
[test-groups]
production-circuit = { max-threads = 1 }

[[profile.default.overrides]]
filter = '''
test(=common::utils::tests::production_public_batch_stays_at_degree_19)
| test(=public_batch::circuit::build::tests::generator_builds_production_public_batch_artifacts)
'''
slow-timeout = { period = "120s", terminate-after = 10 }
test-group = "production-circuit"
34 changes: 25 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ env:
CARGO_TERM_COLOR: always
CARGO_NET_RETRY: 10
CARGO_NET_TIMEOUT: 60
NEXTEST_VERSION: 0.9.151

jobs:
fast-checks:
Expand Down Expand Up @@ -63,15 +64,22 @@ jobs:
- name: Setup macOS
if: matrix.os == 'macos-latest'
uses: ./.github/actions/macos
- uses: taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2.90.3
with:
tool: cargo-nextest@${{ env.NEXTEST_VERSION }}
# Test selection lives in .config/nextest.toml and the -E filtersets.
# Doctests are not supported by nextest and stay on `cargo test --doc`;
# the GPU crate's compile_fail doctests only exist behind its features.
- name: Test workspace (release, fast tests)
run: |
cargo test --workspace --locked --release --lib --bins -- --skip aggregator_tests --skip circuit_data_tests --skip prover_tests --skip verifier_tests
cargo nextest run --profile ci --workspace --locked --release --lib --bins -E 'not (test(aggregator_tests) | test(circuit_data_tests) | test(prover_tests) | test(verifier_tests))'
cargo test --workspace --locked --release --doc
cargo test --release --locked -p tests --test encoding_safety --test spec_differential
cargo test --release --locked -p qp-wormhole-circuit --test heap_zeroization --test formal_trace
cargo test --release --locked -p qp-wormhole-gpu --features constraint-export
cargo test --release --locked -p qp-wormhole-aggregator --features gpu --lib gpu
cargo test --release --locked -p qp-wormhole-aggregator --features gpu --example public_batch_compare
cargo nextest run --profile ci --release --locked -p tests --test encoding_safety --test spec_differential
cargo nextest run --profile ci --release --locked -p qp-wormhole-circuit --test heap_zeroization --test formal_trace
cargo nextest run --profile ci --release --locked -p qp-wormhole-gpu --features constraint-export
cargo test --release --locked -p qp-wormhole-gpu --features constraint-export --doc
cargo nextest run --profile ci --release --locked -p qp-wormhole-aggregator --features gpu --lib -E 'test(gpu)'
cargo nextest run --profile ci --release --locked -p qp-wormhole-aggregator --features gpu --example public_batch_compare

analysis:
name: 🤖 Analysis (Clippy & Doc)
Expand Down Expand Up @@ -163,18 +171,26 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/ubuntu
- uses: taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2.90.3
with:
tool: cargo-nextest@${{ env.NEXTEST_VERSION }}
- name: Build circuit binaries
run: ./scripts/build-circuits.sh
# The `tests` crate generates its circuit artifacts once per test process
# (std::sync::Once); under nextest's process-per-test model every test
# would regenerate them, so this invocation stays on `cargo test`.
- name: Run slow crypto tests
run: |
cargo test --release -p tests -- aggregator_tests circuit_data_tests prover_tests verifier_tests
cargo test --release --package qp-wormhole-aggregator
cargo nextest run --profile ci --release --package qp-wormhole-aggregator
cargo test --release --package qp-wormhole-aggregator --doc
# The 2^19 production public-batch builds peak at ~12 GB each, more than
# the 7 GB macos-latest runner has, so they are #[ignore]d in
# test-workspace and run here one at a time.
# test-workspace. The `production-circuit` test group in
# .config/nextest.toml runs them one at a time.
- name: Run production-shape degree guards
run: |
cargo test --release --locked -p qp-wormhole-aggregator --lib -- --ignored --test-threads=1 production_public_batch_stays_at_degree_19 generator_builds_production_public_batch_artifacts
cargo nextest run --profile ci --release --locked -p qp-wormhole-aggregator --lib --run-ignored only -E 'test(production_public_batch_stays_at_degree_19) | test(generator_builds_production_public_batch_artifacts)'

security-audit:
name: 🔐 Security Audit
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ You can also run tests for a specific package, for example, for the `wormhole-ci
cargo test -p wormhole-circuit
```

CI runs the suite with [cargo-nextest](https://nexte.st) (`cargo nextest run --release`),
which isolates each test in its own process and applies the per-test timeouts in
`.config/nextest.toml`. Doctests still go through `cargo test --doc`.


## Benchmarks

Expand Down
Loading