xd009642/tarpaulin

Failed to get test coverage! Error: missing section: CoverageFunctions

Closed this issue · 7 comments

Cargo tarpaulin failed during the execution of the "check coverage" command line tests. You can review the error details in the GitHub Actions link below:

GitHub Actions - Test Coverage Job

The Cargo tarpaulin configuration can be found at the following link:

Cargo Tarpaulin Configuration

For your reference, an example of the command line test is available here:

Command Line Test Example

Thank you for your attention.

I got this too in Sargon: https://github.com/radixdlt/sargon
Never had an issue until some days ago, hmm...

So this may have been fixed in the latest release, can you confirm if it's still an issue or not?

After cleaning the GitHub Action caches and rerunning the pipeline, I received the same error message: "Error: missing section: CoverageFunctions."

Okay I've realised what the issue is (particularly for pf but sargon is likely the same thing). In pf pf-api and pf-cli are built separately and lack the llvm coverage instrumentation. I'm going to look into how they're built for the tests as maybe tarpaulin should be propagation some rustflags etc in a way that could solve this

Okay I have a PR, you can install it and try it out like:

cargo install cargo-tarpaulin --git https://github.com/xd009642/tarpaulin --branch fix/missing-coverage-functions

I've tested it on pf and it works as expected (and now we also get coverage for the spawned CLI app!) I'll run it through a few more tests probably tomorrow and make sure it doesn't break anything existing.

Yes, the problem is solved. Thank you.

Nice merged in, this'll be in the next release (should be later this week just looking at one other issue beforehand)