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

Setup Soroban baseline code coverage #883

Open
anupsdf opened this issue Jun 23, 2023 · 0 comments
Open

Setup Soroban baseline code coverage #883

anupsdf opened this issue Jun 23, 2023 · 0 comments

Comments

@anupsdf
Copy link
Contributor

anupsdf commented Jun 23, 2023

What?

Setup Soroban baseline code coverage. After this we can work on reporting on coverage for each new PR by hooking up with CI.

Follow the documentation of instrument-coverage.

For local testing in Mac OS, you might need to prefix xcrun to run the llvm-profdata merge command.

I was able to run the cargo wrapper command for llvm-profdata below to create test coverage report,

cd rs-soroban-env

// Run this for HTML report
cargo llvm-cov --features next --html --open --ignore-filename-regex='(.*/cost_runner/.*)|(.*/test/.*)'

If you are using coverage gutters extension in VSCode, you can create the lcov.info file by running,

cargo llvm-cov test --features next  --tests --lcov --output-path=lcov.info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@anupsdf and others