From b986afe9f18d3c34d87f222f6a00573ff51834ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Tue, 9 Apr 2024 11:15:42 +0100 Subject: [PATCH 1/2] make: use `--lib` for cargo tests to avoid building bins and examples --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 401875bb65..3a11c99756 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,7 @@ test-e2e: NAMADA_E2E_USE_PREBUILT_BINARIES=$(NAMADA_E2E_USE_PREBUILT_BINARIES) \ NAMADA_E2E_DEBUG=$(NAMADA_E2E_DEBUG) \ RUST_BACKTRACE=$(RUST_BACKTRACE) \ - $(cargo) +$(nightly) test $(jobs) e2e::$(TEST_FILTER) \ + $(cargo) +$(nightly) test --lib $(jobs) e2e::$(TEST_FILTER) \ -Z unstable-options \ -- \ --test-threads=1 \ @@ -177,14 +177,14 @@ test-e2e: # Run integration tests test-integration: RUST_BACKTRACE=$(RUST_BACKTRACE) \ - $(cargo) +$(nightly) test $(jobs) integration::$(TEST_FILTER) --features integration \ + $(cargo) +$(nightly) test --lib $(jobs) integration::$(TEST_FILTER) --features integration \ -Z unstable-options \ -- \ --test-threads=1 \ -Z unstable-options --report-time test-unit: - $(cargo) +$(nightly) test \ + $(cargo) +$(nightly) test --lib \ $(TEST_FILTER) \ $(jobs) \ -- --skip e2e --skip integration --skip pos_state_machine_test \ @@ -198,7 +198,7 @@ test-unit-with-coverage: -Z unstable-options --report-time test-unit-mainnet: - $(cargo) +$(nightly) test \ + $(cargo) +$(nightly) test --lib \ --features "mainnet" \ $(TEST_FILTER) \ $(jobs) \ @@ -206,7 +206,7 @@ test-unit-mainnet: -Z unstable-options --report-time test-unit-debug: - $(debug-cargo) +$(nightly) test \ + $(debug-cargo) +$(nightly) test --lib \ $(jobs) \ $(TEST_FILTER) \ -- --skip e2e --skip integration --skip pos_state_machine_test \ @@ -224,7 +224,7 @@ test-wasm-templates: $(foreach wasm,$(wasm_templates),$(test-wasm-template) && ) true test-debug: - $(debug-cargo) +$(nightly) test \ + $(debug-cargo) +$(nightly) test --lib \ -- \ --nocapture \ -Z unstable-options --report-time @@ -241,7 +241,7 @@ test-pos-sm: PROPTEST_CASES=$(PROPTEST_CASES) \ PROPTEST_MAX_SHRINK_ITERS=$(PROPTEST_MAX_SHRINK_ITERS) \ RUSTFLAGS='-C debuginfo=2 -C debug-assertions=true -C overflow-checks=true' \ - cargo test pos_state_machine_test --release + cargo test --lib pos_state_machine_test --release fmt-wasm = $(cargo) +$(nightly) fmt --manifest-path $(wasm)/Cargo.toml fmt: From 03abf0df2fbe69993f29aa59050eff8801e1ed46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Wed, 10 Apr 2024 10:34:10 +0100 Subject: [PATCH 2/2] scripts/repeat-e2e-test: also use `--lib` for cargo test --- scripts/repeat-e2e-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/repeat-e2e-test.sh b/scripts/repeat-e2e-test.sh index 2cdea0b47a..a1f06cb626 100755 --- a/scripts/repeat-e2e-test.sh +++ b/scripts/repeat-e2e-test.sh @@ -20,7 +20,7 @@ NIGHTLY=$(cat "$SCRIPTPATH"/../rust-nightly-version) for i in $(seq 1 "$NUM") do echo "Execution $i/$NUM" - if ! RUST_BACKTRACE=1 NAMADA_E2E_KEEP_TEMP=true NAMADA_E2E_DEBUG=true cargo "+$NIGHTLY" test "$TEST" -- --exact --test-threads=1 --nocapture; then + if ! RUST_BACKTRACE=1 NAMADA_E2E_KEEP_TEMP=true NAMADA_E2E_DEBUG=true cargo "+$NIGHTLY" test --lib "$TEST" -- --exact --test-threads=1 --nocapture; then exit 1 fi done