Question regarding dot net tests

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”:

    - development
    - merge_requests
  stage: test
    - build 
    - "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 /$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?


Hi @Lucas_Lobosque,

Yes, because the end step is the step that gathers all files generated by build and test steps.

The only supported scenario currently is to have 1 analysis running for 1 SonarCloud projects, otherwise concurrent analyses on different part of the repository will overwrite what already exist.