Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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"


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

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.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bamboo

Bamboo Data Center on Kubernetes

Hi, If you are running self-managed environments and looking to adopt modern infrastructure, Bamboo Data Center can now be deployed in a Kubernetes cluster. By leveraging Kubernetes, you can easily...

967 views 3 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you