Must-share information (formatted with Markdown):
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
Sonarqube: 8.9
Sonar Scanner: 5.3 -
what are you trying to achieve:
In github actions i am trying to run the below commands with my project and token.
dotnet sonarscanner begin /k:“sonar-project-key”
/d:sonar.login=“sonar-token”
/d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html
dotnet build
dotnet dotcover test --dcReportType=HTML
dotnet sonarscanner end /d:sonar.login=“sonar-token”
Error in the pipeline:
[JetBrains dotCover] Analyzed application exited with code '1'
[JetBrains dotCover] Coverage session finished [12/15/2022 04:08:09]
[JetBrains dotCover] Coverage results post-processing started [12/15/2022 04:08:09]
[JetBrains dotCover] Merging snapshots [12/15/2022 04:08:09]
[JetBrains dotCover] Snapshots merging finished [12/15/2022 04:08:09]
[JetBrains dotCover] Report generation started [12/15/2022 04:08:09]
[JetBrains dotCover] Report generation finished [12/15/2022 04:08:10]
[JetBrains dotCover] Coverage results post-processing finished [12/15/2022 04:08:10]
Error: Process completed with exit code 253.
I am trying to publish the code coverage in the sonar project.
- what have you tried so far to achieve this
All the commands are running as bash in the yaml
```
- name: Sonarqube
shell: bash
run: |
project_name=`basename ${{ github.workspace }}`
export PATH=$PATH:/home/user/.dotnet/tools
cd ${{ github.workspace }}
dotnet nuget add source --username USERNAME --password ${{ secrets.NUGET_AUTH_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/xxxxx/index.json"
dotnet tool install --global JetBrains.dotCover.GlobalTool
dotnet sonarscanner begin /k:"$project_name" /d:sonar.host.url="https://localhost:9000" /d:sonar.login="${{ secrets.SONARQUBE_TOKEN }}" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html
dotnet build
dotnet dotcover test --dcReportType=HTML
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONARQUBE_TOKEN }}"
If i run without /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html and dotnet dotcover test --dcReportType=HTML
it is publishing the report but without code coverage.
Thanks,
Krishna Mohan