get dotCover results inside build

Hi, I need to get the percentage of code coverage inside the build after dotCover runs. I know I can get this data on the xml on .teamcity folder, but now I need it while the build is still running to use on another build step

I'm, using TC 2017.2.1

I've searched on the web but didn't find any response

how can I do this?

Thanks!

0
2 comments

Hi Renato,

it should be somewhat possible, although it might be a bit hard to find and use. The coverage report should be created as a report in disk after the tests with coverage are run, which means it should be possible to find it, parse it and gather the results.

Another, maybe easier option, could be to split the build in two. The first part runs the coverage, then publishes the report as an artifact. The second build picks up the artifact as a dependency, then performs whichever operations are required.

Hope this helps.

0
Avatar
Permanently deleted user

Hi Denis,

Thanks for the response

I prefer to use the first approach, I'm using runner type Nunit with dotCover enabled, I was able to get the file by specifying /Output on additional arguments, but it looks like TC does still try to look at other location to build the code coverage reports. See below

Logs

Nunit step

[18:30:59][Step 11/17] [JetBrains dotCover] Coverage results post-processing started [3/15/2018 6:30:59 PM]
[18:30:59][Step 11/17] [JetBrains dotCover] Coverage results post-processing finished [3/15/2018 6:30:59 PM]
[18:30:59][Step 11/17] Importing data from 'C:\BuildAgent\temp\buildTmp\coverage_dotcover263139273083642881.data' (not existing file) with 'dotNetCoverage' processor
[18:30:59][Step 11/17] Rejected coverage report file: C:\BuildAgent\temp\buildTmp\coverage_dotcover263139273083642881.data size: 0. File is empty or does not exist
[18:30:59][Step 11/17] Process exited with code 0
 
end of log
Cannot calculate build metric 'percentage of statement coverage' - no value
 
0

Please sign in to leave a comment.