Template for a good new topic, formatted with Markdown:
- ALM used - Azure DevOps
- CI system used - Azure DevOps
- Scanner command used when applicable -
inputs:
SonarQube: 'sonarqube-integration'
scannerMode: 'MSBuild'
projectKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxx'
projectName: 'Rulebot_ICRuleEngine'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**\*.bin sonar.cobertura.reportPaths=$(Agent.TempDirectory)/coverage_reports/coverage.cobertura.xml
sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/coverage_reports/coverage.opencover.xml
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx```
- Languages of the repository - .Net
- Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
- Steps to reproduce
- Added the sonarqube tasks to the pipeline.
- Coverage report is being generated on the unit test.
displayName: 'dotnet test'
condition: eq(variables.buildSuccess, 'true')
inputs:
command: 'test'
projects: 'ICRuleEngine/TestProject/TestProject.csproj'
arguments: '--collect:"XPlat Code Coverage" --diag:$(System.DefaultWorkingDirectory)\folder\log.txt --logger trx -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover,cobertura'
publishTestResults: true
- The coverage published on the pipeline is showing 34% but the coverage in sonarqube is 0%
- Potential workaround
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!