You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
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.
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.