Hi, I currently have the following step in my pipeline that build my source code and then run tests, all between the sonar analyser “begin” and “end”:
test:with_analysis:
only:
- development
- merge_requests
stage: test
dependencies:
- build
script:
- "dotnet tool install --global dotnet-sonarscanner --version 4.8.0"
- "export PATH=\"$PATH:/root/.dotnet/tools\""
- apt-get update
- apt-get install openjdk-11-jdk --assume-yes
- "dotnet-sonarscanner begin /k:troco.simples_backend /o:ts /d:sonar.host.url=$SONAR_HOST_URL /d:sonar.login=$SONAR_TOKEN /d:sonar.cs.opencover.reportsPaths=\"**/coverage.opencover.xml\""
- "dotnet build Troco.Web.sln"
- "dotnet test Troco.Services.Test/ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
- "dotnet test Troco.SoftwareExpressApi.Test/ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
- "dotnet test Troco.PartnerApi.Test/ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
- "dotnet test Troco.CustomerApi.Test/ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
- "dotnet test Troco.AdminApi.Test/ /p:CollectCoverage=true /p:CoverletOutputFormat=opencover"
- "dotnet-sonarscanner end /d:sonar.login=$SONAR_TOKEN"
I want parallelyse this as much as possible, so I have some questions:
1 - Is it really necessary to run the tests between the begin and end block?
2 - Is it possible in any way to analyse different projects instead a single solution and have sonarCloud taking care of merging everything together?
Thanks,