diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fb4a7dc..f9bb2c6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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) # ───────────────────────────────────────────────────────────────────────────── diff --git a/src/node/tests/unit.rs b/src/node/tests/unit.rs index 12b0ff7b..5bc4ca87 100644 --- a/src/node/tests/unit.rs +++ b/src/node/tests/unit.rs @@ -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(); }; diff --git a/testing/ci-local.sh b/testing/ci-local.sh index 9b097be5..5a4b6a4f 100755 --- a/testing/ci-local.sh +++ b/testing/ci-local.sh @@ -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 ─────────────────────────────────────────────