Problem getting dotCover reporting in TC without built in tools

Hello,

I'm attempting to run some dotCover reporting in Teamcity, but without using the built in tools.

The project is in .NET 4, uses nunit to run tests, and rake to run tasks.

I'm calling the dotcover (v. 1.2) executable with the analyse command,  thus:

dotcover a /targetexecutable=$$path to nunit-console.exe$$ /targetarguments=$$path to a dll with nunit tests in it$$ /output=coverage.xml

When I run this locally from a command line, everything is as expected. I get test results and a coverage.xml file, which contain the expected information.

Then when checking code in and having Teamcity run the build, I setup a service message to import coverage data to Teamcity, as outlined here:

http://confluence.jetbrains.net/display/TCD6/Manually+Configuring+Reporting+Coverage

My service message looks like this:

"##teamcity[importData type='dotNetCoverage' tool='dotcover' path='path to that coverage.xml file']"


And when the build runs in Teamcity, I see no coverage tab (this is what i'm assuming I should see, please correct if wrong), and the relevant section of the build log contains this (full paths removed):


[10:41:09]Generating coverage report by dotcover for files: [C:\$$PATH$$\coverage.xml]

[10:41:09]Get dotCover version (5s)

[10:41:15][Get dotCover version] Started dotCover: C:\$$PATH$$\dotCover.exe version C:\$$PATH$$\dotCover1848930602588606317Version

[10:41:15][Get dotCover version] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.

[10:41:15][Get dotCover version] dotCover exited with code: 0

[10:41:15]Use DotCover 1.2.x commands set

[10:41:15]Merge dotCover reports (5s)

[10:41:20][Merge dotCover reports] Started dotCover: C:\$$PATH$$\dotCover.exe merge C:\$$PATH$$\dotcover1961034333943353510.xml

[10:41:20][Merge dotCover reports] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.  Failed to obtain source files for the 'merge' command. File 'C:\$$PATH$$\coverage.xml' is nor a snapshot in supported format, nor a coverage results descriptor

[10:41:20][Merge dotCover reports] dotCover exited with code: -2

[10:41:20][Merge dotCover reports] dotCover returned non-zero exit code.

[10:41:20]Remove dotCover snapshot files

[10:41:21][Remove dotCover snapshot files] Started dotCover: C:\ $$PATH$$ \dotCover.exe delete C:\ $$PATH$$ \dotcover6151495620517243520.xml

[10:41:21][Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.  Failed to obtain source files for the 'delete' command. File 'C:\ $$PATH$$ \coverage.xml' is nor a snapshot in supported format, nor a coverage results descriptor

[10:41:21][Remove dotCover snapshot files] dotCover exited with code: -2

[10:41:21][Remove dotCover snapshot files] dotCover returned non-zero exit code.

[10:41:21]Generate dotCover report (2s)

[10:41:24][Generate dotCover report] Started dotCover: C:\$$PATH$$\dotCover.exe report C:\ $$PATH$$ \dotcover2620563795601736666.xml

[10:41:24][Generate dotCover report] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.  Failed to obtain source files for the 'report' command. File 'C:\ $$PATH$$ \dotCover9070853972575333832Merge' is nor a snapshot in supported format, nor a coverage results descriptor

[10:41:24][Generate dotCover report] dotCover exited with code: -2

[10:41:24][Generate dotCover report] dotCover returned non-zero exit code.

[10:41:24]Generate dotCover HTML report

[10:41:24]Packing snapshot files (2s)

[10:41:26][Packing snapshot files] Started dotCover: C:\ $$PATH$$ \dotCover.exe zip C:\ $$PATH$$ \dotcover5406666583263740586.xml

[10:41:26][Packing snapshot files] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.  Failed to obtain source files for the 'zip' command. File 'C:\ $$PATH$$ \dotCover9070853972575333832Merge' is nor a snapshot in supported format, nor a coverage results descriptor

[10:41:26][Packing snapshot files] dotCover exited with code: -2

[10:41:26][Packing snapshot files] dotCover returned non-zero exit code.

[10:41:26]Remove dotCover snapshot files

[10:41:27][Remove dotCover snapshot files] Started dotCover: C:\ $$PATH$$ \dotCover.exe delete C:\ $$PATH$$ \dotcover5948664390392460341.xml

[10:41:27][Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.2.352.19. Copyright (c) 2009-2012 JetBrains s.r.o. All rights reserved.  Failed to obtain source files for the 'delete' command. File 'C:\ $$PATH$$ \dotCover9070853972575333832Merge' is nor a snapshot in supported format, nor a coverage results descriptor

[10:41:27][Remove dotCover snapshot files] dotCover exited with code: -2

[10:41:27][Remove dotCover snapshot files] dotCover returned non-zero exit code.






I'm not sure if I just haven't read the documentation closely enough, and that I need to getnerate something other than an xml output file so Teamcity can do it's work, but haven't been able to find anything on the documentation to answer this question so far - any help hugely appreciated.

Thanks.

Greg.
2 comments

Hello Greg,

In the "path" key of the "ImportData" service message you should specify the path to the raw coverage snapshot, not to the coverage report. Snapshot is generated by the dotCover's "cover" command. So instead of "analyse" (a) command you should use "cover" (c) command:

dotcover c /targetexecutable=$$path to nunit-console.exe$$  /targetarguments=$$path to a dll with nunit tests in it$$  /output=coverage.dcvr

And your service message will look as the following: "##teamcity[importData type='dotNetCoverage' tool='dotcover' path='path to the coverage.dcvr file']"
TeamCity will create html and xml reports by the specified snaphot and put them to the "Hidden artifacts" (.NETCoverage folder).

Please let me know whether it helps.
Regards.

0

Ekaterina - perfect, this is exactly what I needed.

Thankyou.

Greg.

0

Please sign in to leave a comment.