actions-rs / tarpaulin

📈 GitHub Action for code coverage reporting with tarpaulin
MIT License
89 stars 16 forks source link

doc tests aren't being run #17

Closed danieleades closed 2 years ago

danieleades commented 3 years ago

Description

Tarpaulin action is failing to run the doc tests in the project

you can see this in the pull request here - https://github.com/danieleades/rtps/pull/1

Workflow code

on:
  push:
    branches: [main]
  pull_request:

name: Code Coverage

jobs:
  coverage:
    name: coverage
    runs-on: ubuntu-latest
    steps:
      - name: checkout source
        uses: actions/checkout@v2

      - name: Install nightly toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly
          profile: minimal
          override: true

      - name: Run cargo-tarpaulin
        uses: actions-rs/tarpaulin@v0.1

      - name: Upload to codecov.io
        uses: codecov/codecov-action@v2.1.0

Action output

Run actions-rs/tarpaulin@v0.1
  with:
    version: latest
    out-type: Xml
[tarpaulin] downloading cargo-tarpaulin from https://github.com/xd009642/tarpaulin/releases/download/0.18.2/cargo-tarpaulin-0.18.2-travis.tar.gz
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/3c0f4e8f-17d8-4aa6-8eb7-29ef8d9adc47 -f /home/runner/work/_temp/07343baf-ee5e-4134-8983-64d203629497
[tarpaulin] running tests with coverage tracking
/usr/share/rust/.cargo/bin/cargo tarpaulin --out Xml
Oct 10 08:43:25.638  INFO cargo_tarpaulin::config: Creating config
Oct 10 08:43:26.072  INFO cargo_tarpaulin: Running Tarpaulin
Oct 10 08:43:26.072  INFO cargo_tarpaulin: Building project
Oct 10 08:43:26.072  INFO cargo_tarpaulin::cargo: Cleaning project
   Compiling rtps v0.1.0 (/home/runner/work/rtps/rtps)
    Finished test [unoptimized + debuginfo] target(s) in 1.28s
Oct 10 08:43:27.794  INFO cargo_tarpaulin::process_handling::linux: Launching test
Oct 10 08:43:27.794  INFO cargo_tarpaulin::process_handling: running /home/runner/work/rtps/rtps/target/debug/deps/rtps-875fbfce9ad43f4a

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Oct 10 08:43:28.105  INFO cargo_tarpaulin::report: Coverage Results:
|| Tested/Total Lines:
|| src/structure/endpoint.rs: 0/6
|| src/structure/entity.rs: 0/4
|| src/structure/group.rs: 0/4
|| src/structure/guid.rs: 0/5
|| src/structure/locator.rs: 0/2
|| src/structure/participant.rs: 0/44
|| 
0.00% coverage, 0/65 lines covered

Expected behavior

this project has doc tests which should contribute to the coverage. These tests are run by the cargo test workflow

danieleades commented 3 years ago

this is probably a tarpaulin issue, rather than an issue with the action

https://github.com/xd009642/tarpaulin/issues/850

intrepion commented 2 years ago

Have you tried adding --docs to the command?

      - name: Run cargo-tarpaulin
        uses: actions-rs/tarpaulin@v0.1
        with:
          args: '--docs'
danieleades commented 2 years ago

@intrepion, yes thankyou. the issue was resolved in the linked tarpaulin issue