1313 # Additional properties that will be passed to the scanner,
1414 # Put one key=value per line, example:
1515 # sonar.exclusions=**/*.bin
16- sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura .xml
16+ sonar.coverageReportPaths=./sonarqubecoverage/SonarQube .xml
1717
1818 - task : CmdLine@2
1919 inputs :
@@ -25,12 +25,12 @@ steps:
2525 inputs :
2626 command : test
2727 projects : ' **/*[Tt]ests/*.csproj'
28- arguments : ' --configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true '
28+ arguments : ' --configuration $(BuildConfiguration) --collect "XPlat Code coverage"'
2929
3030- script : ' dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8'
3131 displayName : ' Install ReportGenerator tool'
3232
33- - script : ' reportgenerator -reports:$(Agent.TempDirectory)/ **/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"'
33+ - script : ' reportgenerator -reports:**/TestResults/*/ coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube; Cobertura"'
3434 displayName : ' Create reports'
3535
3636# - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5
@@ -42,10 +42,10 @@ steps:
4242# #assemblyfilters: '-xunit\*'
4343
4444- task : PublishCodeCoverageResults@1
45- displayName : ' Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports /coverage.cobertura.xml'
45+ displayName : ' Publish code coverage from $(Build.SourcesDirectory)/**/TestResults/* /coverage.cobertura.xml'
4646 inputs :
4747 codeCoverageTool : Cobertura
48- summaryFileLocation : ' $(Build.SourcesDirectory)/coverlet/reports /Cobertura.xml'
48+ summaryFileLocation : ' $(Build.SourcesDirectory)/**/TestResults/* /Cobertura.xml'
4949
5050- task : SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
5151 displayName : ' Run Code Analysis'
0 commit comments