Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

lakshmi Prathyusha November 21, 2018

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" /d:sonar.host.url="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
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 26, 2018

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
TAGS
AUG Leaders

Atlassian Community Events