anoma / namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy
https://namada.net
GNU General Public License v3.0
2.4k stars 950 forks source link

integrate test code coverage #71

Closed tzemanovic closed 8 months ago

tzemanovic commented 2 years ago

this can run in the CI

james-chf commented 2 years ago

cargo llvm-cov works with our codebase, we could use that. It can export the coverage in lcov format which can then be used with IDE plugins like like Coverage Gutters for VS Code, or uploaded to a service like codecov.io.

Proof of concept - https://app.codecov.io/gh/james-chf/namada-fork/tree/james-chf%2Fcoveralls is the coverage for main generated after running the following command (which also requires cargo-nextest ):

cargo llvm-cov nextest \
    --lcov --output-path .hack/lcov.info --features namada/testing -E "not test(e2e)"
cwgoes commented 1 year ago

@james-chf @juped can we integrate automatic coverage?

james-chf commented 1 year ago

I see we already run coverage in CI and publish it as an artifact - https://github.com/anoma/namada/blob/076e0162047091d9c19051ed05fb3c74363d14e3/.github/workflows/build-and-test-bridge.yml#L225-L235

We could probably upload the coverage file as well to a service like https://codecov.io or https://coveralls.io, to get a nice UI for browsing code coverage (there is also some GitHub integrations we could look at e.g. bots that comment on PRs w.r.t. how they increase (or decrease) test coverage)

grarco commented 8 months ago

Closed by #2148