Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage tooling #448

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions server/run-tests-with-grcov.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/sh -e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the -e needed here?


# install deps
cargo install grcov
rustup component add llvm-tools-preview

# set env vars
# cleanly run the following commands in their own session
bash -c "
# tell Rust to run with coverage instrumentation
RUSTFLAGS="-Cinstrument-coverage"
# give grcov a profile name template for output files
LLVM_PROFILE_FILE="svix-webhooks-%p-%m.profraw"
# put the compiler in nightly mode
RUSTC_BOOTSTRAP=1
svix-dylan marked this conversation as resolved.
Show resolved Hide resolved

# run tests
./run-tests.sh

# back to stable
RUSTC_BOOTSTRAP=0
" || true

# generate and open report output
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
open ./target/debug/coverage/index.html

LOCATION="coverage HTML file at $(pwd)/target/debug/coverage/index.html"
echo "$LOCATION"
svix-dylan marked this conversation as resolved.
Show resolved Hide resolved