Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Wrong coverage using the example Github Workflows in the documentaiton #140

Open
1 of 3 tasks
edmondop opened this issue Nov 9, 2022 · 1 comment
Open
1 of 3 tasks
Labels
bug Something isn't working

Comments

@edmondop
Copy link

edmondop commented Nov 9, 2022

Do the checklist before filing an issue:

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),
}
@edmondop edmondop added the bug Something isn't working label Nov 9, 2022
@williamdes
Copy link

See #141 if Rust stable works better for you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants