After running OpenCover on my computer, the next step is to make it work with the build server.
I am trying to integrate OpenCover with MSBuild on a Bamboo Build Server. I modified Build.proj as follows to run OpenCover after creating the solution:
<Target Name="TestAndCodeCoverage" DependsOnTargets="Build" > <Message Text="Executing Unit Tests and running OpenCover to check code coverage..." /> <MakeDir Directories="Coverage" /> <Exec Command='"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -target:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" -targetargs:/testcontainer:"TestProject\bin\Release\TestProject.dll" -filter:+[*]* -output:Coverage\CodeCoverageResults.xml -register:user -mergebyhash' /> </Target>
The "Coverage" directory is created in the root directory of the solution (which is the working directory at build time). Tests are performed and everything passes, but after Committing.... displayed in the assembly log (which will be displayed on the command line), the results are not generated, and the assembly proceeds to the next task (creating a report using ReportGenerator - this is not performed, because CodeCoverageResults. xml was not created).
When the same command is executed on the command line on the build machine, everything works as expected, and the report can be generated by ReportGenerator.
Has anyone else had the same problem? Do i need to register equivalent dlls, for example, in this PartCover example?
source share