How to publish test results and code coverage using azure pipeline (CI) and .Net Framework

303 Views Asked by At

I am running the azure ci pipeline for .net framework and unit test (VSTest). However, VS test success, code coverage generation success, but test report and code coverage report tab are not showing in pipeline's summary tab. please check the pipeline code and result screenshots.

YAML

- task: VSTest@2
  inputs:
    testSelector: 'testAssemblies'
    platform: 'Any CPU'
    configuration: 'Release'
    testAssemblyVer2: |
      **\*Test*.dll
    searchFolder: '$(System.DefaultWorkingDirectory)'
    resultsFolder: '$(build.ArtifactStagingDirectory)/Test/Results'
    otherConsoleOptions: '/Framework:.NETFramework,Version=v4.7.2 /collect:"Code Coverage;Format=Cobertura"'
    codeCoverageEnabled: True


- task: PublishCodeCoverageResults@1
  displayName: 'Publish Code Coverage'
  inputs:
    codeCoverageTool: Cobertura
    summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Test/Results/**/*.xml'

Test Summary

Not showing the test results

enter image description here

Code Coverage Artifact showing, but Tab Missing in summary

Artifact

enter image description here

Tab Missing

enter image description here

0

There are 0 best solutions below