Skip to content

Commit

Permalink
Merge branch 'tomas/tests-go-brr' (#3033)
Browse files Browse the repository at this point in the history
* tomas/tests-go-brr:
  scripts/repeat-e2e-test: also use `--lib` for cargo test
  make: use `--lib` for cargo tests to avoid building bins and examples
  • Loading branch information
tzemanovic committed Apr 10, 2024
2 parents 09ff289 + 03abf0d commit 7d70e5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand All @@ -198,15 +198,15 @@ test-unit-with-coverage:
-Z unstable-options --report-time

test-unit-mainnet:
$(cargo) +$(nightly) test \
$(cargo) +$(nightly) test --lib \
--features "mainnet" \
$(TEST_FILTER) \
$(jobs) \
-- --skip e2e --skip integration \
-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 \
Expand All @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/repeat-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7d70e5a

Please sign in to comment.