Skip to content

Commit

Permalink
ci: avoid collecting coverage data on local dev (lambdaclass#1519)
Browse files Browse the repository at this point in the history
Add the `TEST_COLLECT_COVERAGE` environmental variable to the `Makefile`
and use it to determine whether to use `llvm-cov` when running tests via
the `make` target.
Set it for CI so the pipelines still collect it. This should both make
local dev faster and save our disk space.

Co-authored-by: fmoletta <[email protected]>
  • Loading branch information
Oppen and fmoletta authored Jan 18, 2024
1 parent e0f37ad commit e806ee3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
cairo_programs/**/*.json
!cairo_programs/manually_compiled/*
examples/wasm-demo/src/array_sum.json
TEST_COLLECT_COVERAGE: 1
PROPTEST_CASES: 100

jobs:
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,20 @@ cairo-vm_proof_trace: $(CAIRO_RS_TRACE_PROOF) $(CAIRO_RS_MEM_PROOF) $(CAIRO_RS_A
cairo_trace: $(CAIRO_TRACE) $(CAIRO_MEM)
cairo-vm_trace: $(CAIRO_RS_TRACE) $(CAIRO_RS_MEM)

TEST_COMMAND:=cargo nextest run
ifdef TEST_COLLECT_COVERAGE
TEST_COMMAND:=cargo llvm-cov nextest --no-report
endif

test: cairo_proof_programs cairo_test_programs cairo_1_test_contracts cairo_2_test_contracts
cargo llvm-cov nextest --no-report --workspace --features "test_utils, cairo-1-hints"
$(TEST_COMMAND) --workspace --features "test_utils, cairo-1-hints"
test-no_std: cairo_proof_programs cairo_test_programs
cargo llvm-cov nextest --no-report --workspace --features test_utils --no-default-features
$(TEST_COMMAND) --workspace --features test_utils --no-default-features
test-wasm: cairo_proof_programs cairo_test_programs
# NOTE: release mode is needed to avoid "too many locals" error
wasm-pack test --release --node vm --no-default-features
test-extensive_hints: cairo_proof_programs cairo_test_programs
cargo llvm-cov nextest --no-report --workspace --features "test_utils, cairo-1-hints, extensive_hints"
$(TEST_COMMAND) --workspace --features "test_utils, cairo-1-hints, extensive_hints"

check-fmt:
cargo fmt --all -- --check
Expand Down

0 comments on commit e806ee3

Please sign in to comment.