In my web api project I have written unit test in Specflow (MStest). FYI: all my test cases pass.
This is the build pipeline:
- task: DotNetCoreCLI@2
displayName: 'Install ReportGenerator'
inputs:
command: custom
custom: tool
arguments: 'install --global dotnet-reportgenerator-globaltool
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '**/project/webApi/**/*Tests.csproj'
publishTestResults: false
arguments: '--configuration $(buildConfiguration) /p:Collect="XPlat Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/ "/p:MergeWith=../TestResults/coverlet.json"'
- task: PublishCodeCoverageResults@1
displayName: CodeCoverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/**/Coverage/*.xml'
- task: reportgenerator@4
inputs:
reports: '$(Build.SourcesDirectory)/**/*.cobertura.xml'
targetdir: '$(Build.SourcesDirectory)/CoverageResults'
The xml file which has to be generated is not generated. When tried to publish the code using Coberta
Error: the report file pattern 'D:\a\1\s/**/*.cobertura.xml' is invalid. No matching files found.
No report files specified
Here's a screenshot for illustration:
