Merging dotCover snapshots from different build configurations

Hi,

I have a project with several build configurations and some of them run a specific set of tests.
I collect coverage data with dotCover for each build configuration using the out of the box features of TC, but this obviously only gives me partial results for each build configuration. I would like to aggregate these to give me the overall code coverage for the entire project.

I see dotCover has a merge command, which is I think what I need, I just wonder if anyone has done this before in TeamCity and is willing to share examples or advice on the best way of doing this. My plan right now is to include the dotCover snapshot file in the artifacts of each individual test build and then use these in a new build configuration to perform the dotCover merge, the problem with this is that the out of the box dotCover approach automatically deletes the snapshot files:

Report generation started [18/10/2011 17:20:54] Report generation finished [18/10/2011 17:20:56]
[17:20:56]: [Generate dotCover report] dotCover exited with code: 0
[17:20:56]: Generate dotCover HTML report (3s)
[17:20:59]: Remove dotCover snapshot files (3s)
[17:21:03]: [Remove dotCover snapshot files] Started dotCover: C:\BuildAgent\tools\dotCover\dotCover.exe zip C:\BuildAgent\temp\buildTmp\dotcover1699953736532601715.xml
[17:21:03]: [Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2011 JetBrains s.r.o. All rights reserved.
[17:21:03]: [Remove dotCover snapshot files] dotCover exited with code: 0
[17:21:03]: Remove dotCover snapshot files
[17:21:03]: [Remove dotCover snapshot files] Started dotCover: C:\BuildAgent\tools\dotCover\dotCover.exe delete C:\BuildAgent\temp\buildTmp\dotcover4789228662350999669.xml
[17:21:03]: [Remove dotCover snapshot files] Output: JetBrains dotCover Console Runner v1.1.252.2. Copyright (c) 2009-2011 JetBrains s.r.o. All rights reserved.
[17:21:03]: [Remove dotCover snapshot files] dotCover exited with code: 0


Do you know how to prevent these from being deleted?

Alex

5 comments
Comment actions Permalink

Hi Alex

Starting from version 6.5 coverage snapshots are published as hidden artifacts.
Capture.PNG

Michael

0
Comment actions Permalink

It works.
I created a new build config and used Powershell to post service messages to dotCover, and used artifact dependencies to get the hidden snapshots.

Thanks,
Alex

0
Comment actions Permalink

Alex - Can you tell more about how you post service messages to dotCover, I am trying to do the exact same thing. Thanks !

0
Comment actions Permalink

I have setup a new build configuration with artifact dependencies to the builds with dotCover snapshots to merge, the artifact paths are:

.teamcity/.NETCoverage/dotCover.snapshot=>integrationsql\

.teamcity/.NETCoverage/dotCover.snapshot=>integrationoracle\

The build configuration simply runs a powershell script to publish the service messages:

Write-Host "##teamcity[importData type='dotNetCoverage' tool='dotcover' path='integrationsql\dotCover.snapshot']";

Write-Host "##teamcity[importData type='dotNetCoverage' tool='dotcover' path='integrationoracle\dotCover.snapshot']";

0

Please sign in to leave a comment.