我正在为 ASP.NET Core 3.1 应用程序设置 Azure DevOps 管道,并且我有以下 YAML 定义测试段)用于构建、测试和代码覆盖率。
- task: DotNetCoreCLI@2
displayName: "dotnet global test tool install"
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install --global dotnet-reportgenerator-globaltool'
- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: 'test'
projects: '**/*[Tt]ests'
arguments: '--no-build --configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(System.DefaultWorkingDirectory)/TestResults/Coverage'
testRunTitle: 'Unit Test'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- script: reportgenerator -reports:$(System.DefaultWorkingDirectory)/**/cobertura/coverage.xml -targetdir:$(System.DefaultWorkingDirectory)/CodeCoverage -reporttypes:HtmlInLine_AzurePipelines
displayName: "create code coverage report"
- task: PublishCodeCoverageResults@1
displayName: "publish test coverage result"
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/cobertura/coverage.xml'
我可能做错了什么?项目来源:GitHub