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

Bamboo shows testcases are 0 even though there are testcases in the application

In Bamboo portal, I have created different tasks in which I checkout the code and fetch latest code, build the solution using MSBuild, run the Sonarqube analysis using Scripts.

The scripts also contains the scripts for running the testcases.This is how it looks.

Task1 : Source code checkout configuration : I have selected the repository name.

Task2 : Command Configuration : This steps restores the Nuget packages into the solution

Task3 : Script Configuration : Start Sonar Scanner Script used is :

"C:\sonar-scanner-msbuild-net461\MSBuild.SonarQube.Runner.exe" begin /k:"ProjectKey" /n:"ProjectName" /v:"1" /"SonarqubeURL" /d:sonar.login=435454352345fgdfdsfvdc342434 /d:sonar.cs.vscoveragexml.reportsPaths="C:\Project\Application.coveragexml"

Task4 : Command Configuration : MSBuild : Builds the solution

Task5 : Script Configuration : Run unit Tests: Scripts used : One will run the test cases and generates a binary file, another one will convert binary to XML coverage file

"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" collect /output:"C:\Project\Application.coverage" "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "TestProject\bin\Release\TestProject.dll"

"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Team Tools\Dynamic Code Coverage Tools\CodeCoverage.exe" analyze /output:"C:\Project\Application.coveragexml" "C:\Project\Application.coverage"

Task6 : Script Configuration : End Sonar Scanner

"C:\sonar-scanner-msbuild-net461\MSBuild.SonarQube.Runner.exe" end /d:sonar.login=435454352345fgdfdsfvdc342434

These are the tasks in my stage in Bamboo. Task6 publishes the results of testcases to Sonarqube dashboard. Now this is all happening as expected.

But when I run this plan, it shows it is a testless build. Task5 is running all the testcases, but how to make Bamboo know that the test cases are running. Also , if any of the unit testcases are failing, how to show the no of test cases successful and failed ,like test cases passed :X , failed :Y.

Is there any additional step am I missing? Any help is much appreciated.

PS : This is a windows service in c# and used MStest for writing testcases.

1 answer

0 votes

Hi @lakshmi Prathyusha,

Bamboo knows about tests when it parses the results, but for that you need to tell it where the files are and what is the test type used. In order to do this we have test runner and parsing tasks.

We have a page referencing the tasks supporting this: Configuring a test task - Atlassian  Documentation.

There is also a task called VSTest runner. This task is not documented yet but it can be use for both calling and parsing the VSTest.

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...

944 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