David Bulg
David Bulg

Reputation: 25

Is there a way to integrate task into Azure Devops server?

I have a YAML task that runs tests on .NET solutions in Azure pipeline. It is meant to run after a build step and execute Unit-tests on that assembly. The output is a simple XML file with test results that needs to be shown after each build run in the summary tab.

How can I make it recognizable by azure?
For example: MsBuild step is recognized and shown in the summary menu as Build Artifacts and have the option to download them from Azure UI. How can I make Azure recognize my task and show it's artifacts and info too? How many tests ran and info in the title and when I click drop it will show artifacts

Summary menu after build run on Azure DevOps server

enter image description here

Upvotes: 0

Views: 112

Answers (2)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30333

You can use ##vso[task.uploadsummary]local file path to upload summary to the build summary. However you may need to write the contents of xml file into md file. please check here to learn more upload tasks.

- powershell: '##vso[task.uploadsummary]path to test result'

However test results isnot intended to be displayed on the summary page.

You must have noticed that there is a Test tab beside Summary tab. Usually the test results will be automatically published by Vstest tasks and the test results will be displayed in Test tab.

You can also publish your test results using task PublishTestResults as mentioned by @4c74356b41. You test results will then be displayed in Test tab.

Upvotes: 0

4c74356b41
4c74356b41

Reputation: 72171

If you are asking how to make your test results visible in the build summary, there is task meant for that specifically.

- task: PublishTestResults@2
  inputs:
    testResultsFormat: 'JUnit' # Options: JUnit, NUnit, VSTest, xUnit, cTest
    testResultsFiles: '**/TEST-*.xml' 

your test results should be compatible with one of the supported versions

Upvotes: 0

Related Questions