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.
...roperties: -Dbamboo.bitbucket.cloud.use.workspace.api=true There are patches available for Bamboo versions 6.8.3, 6.9.2, and 6.10.5 on the bug report that add support for the System Property. T...
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