From b312a5323b3621f4a561416c2f76044e8a58c3ea Mon Sep 17 00:00:00 2001 From: Shane <shane.osborne@microsoft.com> Date: Wed, 9 Mar 2022 11:29:02 +0000 Subject: [PATCH] Allow generation of HTML Code Coverage reports Currently when running this pipeline a message ##[warning]Please install dotnet core to enable automatic generation of Html report. is displayed under code coverage. This fix adds an addiitonal task to install .Net Core SDK as well as set the environment variable DOTNET_SYSTEM_GLOBALIZATION_INVARIANT to 1 for the publish coverage report task. A new warning will now be shown- ##[warning]Ignoring coverage report directory with Html content as we are auto-generating Html content However now if you view the code coverage report it is HTML generated and looks a lot better than before --- .pipelines/code-quality-template.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pipelines/code-quality-template.yml b/.pipelines/code-quality-template.yml index afaf7a9a..9e8fc549 100644 --- a/.pipelines/code-quality-template.yml +++ b/.pipelines/code-quality-template.yml @@ -17,9 +17,17 @@ steps: failTaskOnFailedTests: true displayName: 'Publish test results' +- task: UseDotNet@2 + displayName: 'Install .NET Core SDK' + inputs: + version: 3.1.x + performMultiLevelLookup: true + - task: PublishCodeCoverageResults@1 displayName: 'Publish coverage report' condition: succeededOrFailed() + env: + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1' inputs: codeCoverageTool: Cobertura summaryFileLocation: 'coverage.xml'