OpenCover MSBuild Integration - No Results Generated

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?

+4
source share
1 answer

Since the build server is a service, I would only use the -register switch, but if I always said on the build server that you should register both 32-bit and 64-bit profilers once using regsvr32 and then release - register switch, i.e. There is no need to register and unregister the profiler every time.

The -register [: user] switch is intended for those scenarios in which people (for example, me) like to work under limited permissions.

+4
source

All Articles