I installed OpenCover in my MSBuild script, configured ReportGenerator and displayed it as an artifact and had a user tab - all this works fine. Here is my MSBuild goal:
<Target Name="Test">
<Exec Command="..\..\tools\OpenCover.4.0.519\OpenCover.Console.exe -register:user -target:..\..\tools\NUnit\nunit-console.exe -targetargs:"$(TestAssemblies) /xml=NUnitReport.xml /noshadow" -filter:"+[HelloWorld.Mvc3UI*]* -[HelloWorld.Mvc3UI.UnitTests*]*" -output:OpenCoverReport.xml"></Exec>
<Exec Command="..\..\tools\ReportGenerator.1.5.0.0\ReportGenerator.exe OpenCoverReport.xml OpenCoverReport"></Exec>
</Target>
However, to run OpenCover, he joins the NUnit runner to create a report, which, in turn, runs all unit tests. Although this may lead to the release of xml for unit tests, I have yet to find the xsl file for reporting as well as the ones that were built into TeamCity 7.1, and even more so in the filtering and search functions.
But if I turn on reports in TeamCity using the built-in NUnit runner (apparently the only way to get a unit test report in TeamCity), it re-runs the unit tests to generate its report.
While all this works, my question is, is there a way to get both reports without having to repeat all unit tests twice? In particular, can OpenCover generate a report without running NUnit tests or can TeamCity generate a report without running unit tests?
Please note that this is an ASP.NET MVC3 application, and the OpenCover documentation does not indicate how to connect ASP.NET or is even possible, but it is pretty clear that this requires an application. Also note that I'm using NUnit 2.6.1 in case that matters.