-
Notifications
You must be signed in to change notification settings - Fork 25
tests: improve unit test coverage and set threshold #296
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
Changes from all commits
61d9d69
9a38962
35a1952
40786bc
646fb68
89e1847
ec37ac9
5d986f2
1636d96
c956a66
22372c3
bde48bb
826e41e
667065a
31e1220
0cc5d16
041d369
6755ff9
967eb61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,22 +34,44 @@ jobs: | |
| RUST_BACKTRACE: 1 | ||
|
|
||
| - name: Test for no_std | ||
| run: cargo test --release --no-default-features --features embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc | ||
| run: cargo test --release --no-default-features --features | ||
| embassy-rt,core,utils,wallet,models,helpers,websocket,json-rpc | ||
| env: | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| - name: Install cargo-llvm-cov | ||
| uses: taiki-e/install-action@cargo-llvm-cov | ||
|
|
||
| # Unit-test coverage is scoped via Cargo features rather than path | ||
| # exclusion. The minimal feature set (`std,core,utils,wallet,models`) | ||
| # compiles only the pure-logic modules — pure crypto, codec, address | ||
| # codec, transaction models, and the `signing` module. Integration- | ||
| # territory code (CLI, async network clients, sync wrappers around | ||
| # network calls, faucet client) is gated behind `helpers`/`json-rpc`/ | ||
| # `websocket`/`cli` features, so it simply isn't compiled here and | ||
| # doesn't appear in the coverage report. Those files are exercised by | ||
| # the integration-test workflow against a live rippled. | ||
| - name: Generate coverage report | ||
| run: cargo llvm-cov --lcov --output-path lcov.info | ||
| run: | | ||
| cargo llvm-cov \ | ||
| --no-default-features --features std,core,utils,wallet,models \ | ||
| --lcov --output-path lcov.info | ||
|
|
||
| - name: Check coverage thresholds | ||
| run: | | ||
| cargo llvm-cov --summary-only \ | ||
| --fail-under-lines 73 \ | ||
| --fail-under-regions 75 \ | ||
| --fail-under-functions 67 | ||
| --no-default-features --features std,core,utils,wallet,models \ | ||
| --fail-under-lines 83 \ | ||
| --fail-under-regions 85 \ | ||
| --fail-under-functions 73 | ||
|
Comment on lines
+64
to
+66
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the fail threshold parameters are redundant with the Codecov checks, because the latter also performs coverage checks.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only |
||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: lcov.info | ||
| flags: unit | ||
| fail_ci_if_error: true | ||
|
|
||
| - name: Upload coverage report | ||
| uses: actions/upload-artifact@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| coverage: | ||
|
pdp2121 marked this conversation as resolved.
|
||
| status: | ||
| project: | ||
| default: | ||
| target: 83% | ||
| threshold: 1% | ||
| flags: | ||
| - unit | ||
| patch: | ||
| default: | ||
| target: 80% | ||
| threshold: 1% | ||
|
|
||
| comment: | ||
| layout: "reach, diff, flags, files" | ||
| require_changes: false | ||
|
|
||
| flags: | ||
| unit: | ||
| paths: | ||
| - src/ | ||
Uh oh!
There was an error while loading. Please reload this page.