diff --git a/.claude/rules/commands.md b/.claude/rules/commands.md index c8c56fcb6..c6034564c 100644 --- a/.claude/rules/commands.md +++ b/.claude/rules/commands.md @@ -12,6 +12,7 @@ Use project Make targets by default. - `make test` - all tests, release mode (standard) - `make test-debug` - all tests, debug mode - `make nextest-release` / `make nextest-debug` - nextest runner +- `make test-spec-tests` / `make nextest-spec-tests` - `spec_tests` with `fake_crypto` (full proposer block coverage) - `cargo test -p ` - specific crate - `make check-benches` - compile benchmarks without running diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 389b1bac5..ff1c9cb14 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -101,6 +101,26 @@ jobs: - name: Show cache stats if: env.SELF_HOSTED_RUNNERS == 'true' run: sccache --show-stats + spec-tests-fake-crypto: + name: spec-tests-fake-crypto + needs: [check-labels] + if: needs.check-labels.outputs.skip_ci != 'true' + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Get latest version of stable Rust + if: env.SELF_HOSTED_RUNNERS == 'false' + uses: moonrepo/setup-rust@v1 + with: + cache: false + cache-target: release + bins: cargo-nextest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run spec_tests with fake_crypto + run: make nextest-spec-tests check-fmt: name: check-fmt runs-on: ubuntu-22.04 @@ -224,6 +244,7 @@ jobs: 'check-labels', 'release-tests-ubuntu', 'debug-tests-ubuntu', + 'spec-tests-fake-crypto', 'check-fmt', 'check-code', 'check-msrv', diff --git a/Makefile b/Makefile index f01d5fd24..7b7c9ea2b 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,15 @@ coverage: coverage-html: cargo llvm-cov nextest --workspace --features "$(TEST_FEATURES)" --html +# Runs `spec_tests` with `fake_crypto` for full proposer block coverage +# (workspace run already covers the BLS-rejection path). +test-spec-tests: + cargo test --release -p spec_tests --features fake_crypto + +# Same as `test-spec-tests`, using nextest. +nextest-spec-tests: + cargo nextest run --release -p spec_tests --features fake_crypto + # Runs cargo-fmt (linter). cargo-fmt: cargo +$(PINNED_NIGHTLY) fmt --all @@ -133,7 +142,7 @@ mdlint: ./scripts/mdlint.sh # Runs the entire test suite -test-full: cargo-fmt test-release test-debug +test-full: cargo-fmt test-release test-debug test-spec-tests # Lints the code for bad style and potentially unsafe arithmetic using Clippy. # Clippy lints are opt-in per-crate for now. By default, everything is allowed except for performance and correctness lints.