grcov
grcov copied to clipboard
Wrong coverage using the example Github Workflows in the documentaiton
Do the checklist before filing an issue:
- [x] Is this related to the
actions-rs
Actions? If you think it's a problem related to Github Actions in general, use GitHub Community forum instead: https://github.community - [ ] You've read the Contributing section about bugs reporting: https://github.com/actions-rs/.github/blob/master/CONTRIBUTING.md#reporting-bugs
- [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome.
Description
Using a Github Workflow like the one suggested in the documentation, macro invocation is considered as not covered by tests, although it is.
Workflow code
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests -Cinstrument-coverage'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests -Cinstrument-coverage'
- uses: actions-rs/[email protected]
id: coverage
name: Generate code coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
files: ${{ steps.coverage.outputs.report }}
token: ${{ secrets.CODECOV_TOKEN }}
Expected behavior
This code of the thiserror
macro be covered, instead it is not:
#[derive(Error, Debug, PartialEq, Eq)]
pub enum EncodingFormatParsingError {
#[error("Unexpected encoding {0}")] // line not covered
UnexpectedEncoding(String),
}