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’ll 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
Show file tree
Hide file tree
Changes from 2 commits
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
3 changes: 3 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ Cargo.lock
Session.vim

.env

# grcov outputs
*.profraw
20 changes: 20 additions & 0 deletions server/run-tests-with-grcov.sh
Original file line number Diff line number Diff line change
@@ -0,0 +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
svix-dylan marked this conversation as resolved.
Show resolved Hide resolved

# set env vars
RUSTFLAGS="-Cinstrument-coverage"
LLVM_PROFILE_FILE="svix-webhooks-%p-%m.profraw"
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

# 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