Teamcity opencover integration
Hi,
We run our tests as part of the test phase of every build which constructs an NUnit console command and executes it in parallel with all test assemblies, failing the build if the tests fail. Using parameter arguments we can instruct this phase to run the tests through a coverage tool. Currently we support both dotcover and opencover which basically wraps these command in the corresponding coverage command. This all works very well and when using dotcover we publish teamcity messages for the coverage reports e.g. "##teamcity[importData type='dotNetCoverage' tool='dotcover' path='MYPATH']" which then gives us the summary view and coverage tab in Team City. Unfortunately the version of NUnit we use can return -100 on the console on a successful run ('https://bugs.launchpad.net/nunitv2/+bug/881958'). When running directly we just ignore this exit code. When running with opencover we use '-returntargetcode' to get the NUnit return code and again ignore the -100. Dotcover however doesn't currently have this feature and returns -3 for target failure. I have submitted this to dotcover and they have created a feature request to return the nunit return code on request rather the targets code being hidden (http://dotnettools-support.jetbrains.com/requests/970). For now this pretty much limits our dotcover useage.
My question is: Is there a way that I can get the Opencover reports to be processed by teamcity messages rather than dotcover which will display the equivalent screens as dotcover does. The documentation (http://confluence.jetbrains.com/display/TCD8/Manually+Configuring+Reporting+Coverage) seems to suggest that only dotcover, partcover, ncover or ncover3 are supported. I can see that there is a plugin to run opencover (https://github.com/mindriven/TeamCity-OpenCoverRunner) but running opencover isn't the issue we just need the reports processing and displaying as dotcover does. We already currently run report generator over the coverage.xml files and add the generated index.htm file and supporting files to a Teamcity tab. What I am wanting is the team city summary screen (Picture attached) and coverage tab which you get when using the other tools..
Attachment(s):
CoverageMain.jpg
coveragesummary.jpg
Please sign in to leave a comment.
Hi,
OpenCover is not supported by TeamCity. please watch/vote for related feature request.
To add the code coverage summary you can use the following service messages:
You can find keys description here. Also see this section.
Coverage tab (CoverageMain.jpg screenshot) should be created as .html file and published as an artifact (you can find an example of this page in dotCover coverage.zip hidden artifact).
Ok thanks, how do I vote for the feature 'TW-37205 Support OpenCover for .NET Code Coverage'
To vote for an issue you need to register and press "Vote for the issue" button at right bottom corner of issue description ("thumb up" icon).