mirror of
https://github.com/jmcorgan/fips.git
synced 2026-10-05 19:18:25 +00:00
fix(test/ci): compile the library tests in release mode, and keep them compiling
`Node::debug_assert_peer_maps_coherent` exists only under `#[cfg(debug_assertions)]`, and the handshake-presence test called it without that gate, so `cargo test --release --lib` failed to build with E0599 while every sibling call site was gated correctly. Gate the call rather than the whole test, so the rest of its assertions still run under `--release`. Nothing noticed, because no runner ever compiled the test target with optimisations: local CI builds release binaries but tests in debug, and the GitHub unit-test job does the same. Add `cargo test --release --lib --no-run` to both runners so the next debug-only helper used without its gate fails at once instead of waiting for someone to run the suite in release.
This commit is contained in:
@@ -330,6 +330,14 @@ jobs:
|
||||
- name: Run library tests with the tick-body profiler enabled
|
||||
run: cargo test --lib --features profiling
|
||||
|
||||
# Debug-only helpers (anything behind #[cfg(debug_assertions)]) vanish in
|
||||
# a release build, so a test calling one without the same gate breaks a
|
||||
# build no other job performs: every run above compiles the test target
|
||||
# in debug. Compile it in release too, without running it — the point is
|
||||
# that it builds at all. Mirrored in testing/ci-local.sh.
|
||||
- name: Compile the library tests in release mode
|
||||
run: cargo test --release --lib --no-run
|
||||
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Job 2b – Unit tests (macOS)
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -3977,7 +3977,10 @@ fn handshake_presence_tracks_the_carrier_not_the_noise_handles() {
|
||||
"rekey-msg2 discriminator: {when}"
|
||||
);
|
||||
// Fires the live-carrier coherence assertion; a machine that had gone
|
||||
// invisible would panic here rather than fail an assert_eq above.
|
||||
// invisible would panic here rather than fail an assert_eq above. The
|
||||
// helper only exists in debug builds, so the rest of this test carries
|
||||
// on without it under `--release`.
|
||||
#[cfg(debug_assertions)]
|
||||
node.debug_assert_peer_maps_coherent();
|
||||
};
|
||||
|
||||
|
||||
@@ -603,6 +603,20 @@ run_tests() {
|
||||
else
|
||||
record "unit-tests-profiling" 1
|
||||
fi
|
||||
|
||||
# Debug-only helpers (anything behind #[cfg(debug_assertions)]) vanish in a
|
||||
# release build, so a test calling one without the same gate breaks a build
|
||||
# nothing here ever performs: every run above compiles the test target in
|
||||
# debug. Compile it in release too, without running it — the point is that
|
||||
# it builds at all. Mirrored in .github/workflows/ci.yml; check-ci-parity.sh
|
||||
# compares integration suites only and would not catch a stage added to one
|
||||
# runner and not the other.
|
||||
info "cargo test --release --lib --no-run"
|
||||
if cargo test --release --lib --no-run 2>&1; then
|
||||
record "release-test-compile" 0
|
||||
else
|
||||
record "release-test-compile" 1
|
||||
fi
|
||||
}
|
||||
|
||||
# ── Stage 3: Integration Tests ─────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user