How to get the Coverage report for .net unit test cases via opencover

Deleted user May 22, 2018

Hi Team,

We are running the Unit test cases via MSTest runner Plugin on Bamboo and the test files are generated on build agent machine.

We are trying to get the coverage report for result files using opencover via script task but getting error

Below is the script task

set mse="D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7"
set out="D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\openCover"
cd "D:\Program Files\OpenCover.4.6.519\tools\"

.\OpenCover.Console.exe -target:$mse\IDE\mstest.exe" -targetargs:"/noisolation /testcontainer:\"D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\Q2.TCWA\UnitTests\API.Tests\bin\Release\API.Tests.dll\"" /resultsfile:"D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\APItest.trx" -reports:"D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\TestResults\openCover" -targetdir: "D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\TestResults\openCover\html" -filter:"+[]" -mergebyhash -output:"$out"\TCWA-Q2TCWAD-JOB1.CodeCoverage.xml"

Error:

The argument '/testcontainer:\D:\bamboo-agent-home\xml-data\build-dir\TCWA-Q2TCWAD-JOB1\Q2.TCWA\UnitTests\API.Tests\bin\Release\API.Tests.dll"' is not recognised

 

I am new to bamboo. Please help me with it

 

 

1 answer

0 votes
Gabriel Ribeiro
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 26, 2018

Hi Sowmya,

As you can see in the improvement request below, Bamboo does not support OpenCover "out of the box" :

After a quick search, I found the following blog post that, at first glance, seems to be a pretty good way to workaround this limitation. This method uses an intermediary step with NCover. You can try it out and see if it works in your case.

thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events