I have created a build pipeline in Azure DevOps for one of my ASP.NET MVC application. There exist projects for unit testing, and I need to generate code coverage report, for which I have used coverlet.msbuild NuGet package, and "ReportGenerator".
Following is the packages.config file of one of the unit test project:
<packages>
<package id="coverlet.msbuild" version="2.8.0" targetFramework="net461" developmentDependency="true" />
<package id="NUnit" version="2.6.3" targetFramework="net45" />
<package id="ReportGenerator" version="4.4.6" targetFramework="net461" />
</packages>
Also, please find the yaml of Build solution, test assemblies, and ReportGenerator tasks in build pipeline:
Build Solution:
steps:
- task: VSBuild@1
displayName: 'Build solution **\SmartStoreNET.sln'
inputs:
solution: '**\SmartStoreNET.sln'
msbuildArgs: '/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
Test Assemblies
steps:
- task: VSTest@2
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
codeCoverageEnabled: true
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
ReportGenerator
steps:
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
displayName: ReportGenerator
inputs:
reports: '$(Build.SourcesDirectory)/tests/**/coverage.cobertura.xml'
targetdir: '$(Build.SourcesDirectory)/CodeCoverage'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
While executing the pipeline I am getting following error in ReportGenerator task:
The report file pattern 'd:\a\1\s/tests/**/coverage.cobertura.xml' is invalid. No matching files found.
Can anyone please suggest what is missing here, or what could be the potential issue.
Any help on this would be much appreciated.
Thanks,
Nirman