Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue running code coverage with dotCover in release mode

Has anyone successfully run coverage reporting using dotCover (and ideally TeamCity) while targeting release mode in the application? Here's the error message I received (this configuration works in debug mode):

Generate dotCover report (6s)
[09:53:44][Generate dotCover report] Started dotCover: E:\BuildAgent3\tools\dotCover\dotCover.exe report F:\TCAgents\ag3temp\buildTmp\dotcover3521342814066873775.xml
[09:53:44]
[Generate dotCover report] Output: JetBrains dotCover Console Runner v2.0.425.62. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.

[JetBrains dotCover] Report generation started [8/29/2012 9:53:43 AM]
[JetBrains dotCover] Report generation finished [8/29/2012 9:53:43 AM]
[Generate dotCover report] dotCover exited with code: 0
Generate dotCover HTML report
[Generate dotCover HTML report] No source files were found under the build checkout directory F:\TCAgents\ag3work\724608d32a4f6354. No source files will be included in dotCover report as source code of classes.

We would like to produce one set of compiled artifacts to pass through the delivery pipeline (including deployment). We didn't run into this problem with NCover - it was able to produce coverage on our release build.

Note: .pdb files are being generated in release mode

like image 260
Danny Douglass Avatar asked Jan 21 '26 07:01

Danny Douglass


1 Answers

According to the logs, snapshot was taken normally and coverage statistics must be presented. Looks like source code build and coverage analysis are in different build configurations. You can either put build and coverage analysis in a single configuration or configure source code mapping by TC-parameter

dotNetCoverage.dotCover.source.mapping (format: path1 => path2)

Current checkout dir can be specified as % teamcity.build.checkoutDir%

like image 199
Daria Dovzhikova Avatar answered Jan 24 '26 11:01

Daria Dovzhikova



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!