4

I am using Azure CLI task type in my build pipeline to run tests. I am using this task type to resolve a problem when tests cannot access Azure Key Vault (see this answer: https://stackoverflow.com/a/56863107/1600629)

I have this inline script:

dotnet test --configuration $(buildConfiguration) --logger trx --results-directory $(Common.TestResultsDirectory)

Tests are running fine, but results are not published, and I cannot see them on the "Tests" tab.

Before I used "NET Core" task type with "test" command, this task has an option to "Publish test results and code coverage", and in this case test results are published, but tests cannot access Azure Key Vault, so I cannot use it.

I need similar behavior with test results for Azure CLI task. Does anybody know how to achieve this? Thank you in advance.

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Taras
  • 205
  • 3
  • 8

1 Answers1

2

You need to add Publish Test Results task:

enter image description here

Or in yaml:

steps:
- task: PublishTestResults@2
  displayName: 'Publish Test Results *.trx'
  inputs:
    testResultsFormat: VSTest
    testResultsFiles: '*.trx'
    searchFolder: '$(Common.TestResultsDirectory)'
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114