Reputation: 1973
For the Azure DevOps 'Publish Test Results' pipeline, when the task is run I get an output like below:
2022-02-01T18:40:55.7299825Z ##[section]Starting: Publish Test Results **/e2eResults.xml
2022-02-01T18:40:55.7308111Z ==============================================================================
2022-02-01T18:40:55.7308433Z Task : Publish Test Results
2022-02-01T18:40:55.7308846Z Description : Publish test results to Azure Pipelines
2022-02-01T18:40:55.7309270Z Version : 2.198.0
2022-02-01T18:40:55.7309681Z Author : Microsoft Corporation
2022-02-01T18:40:55.7310042Z Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
2022-02-01T18:40:55.7310427Z ==============================================================================
2022-02-01T18:40:57.2361642Z [command]/usr/bin/dotnet --version
2022-02-01T18:40:57.2362016Z 5.0.404
2022-02-01T18:40:58.9100220Z Result Attachments will be stored in LogStore
2022-02-01T18:40:58.9582047Z Run Attachments will be stored in LogStore
2022-02-01T18:40:59.0471397Z ##[section]Async Command Start: Publish test results
2022-02-01T18:40:59.3342360Z Publishing test results to test run '1024564'.
2022-02-01T18:40:59.3377826Z TestResults To Publish 2, Test run id:1024564
2022-02-01T18:40:59.3419843Z Test results publishing 2, remaining: 0. Test run id: 1024564
2022-02-01T18:41:00.2260832Z Published Test Run : https://<test run URL here>
2022-02-01T18:41:00.7854816Z ##[section]Async Command End: Publish test results
2022-02-01T18:41:00.7857495Z ##[section]Finishing: Publish Test Results **/e2eResults.xml
It would be VERY helpful if the test run url could be output by the task, so i could add some bash/powershell task afterwards to send an email or PR comment that says 'hey, here are the results of your test run'. Is there a way to do this already, or is this a feature I have to request?
Upvotes: 1
Views: 1827
Reputation: 115025
You can send the good folks at the azure-pipelines-tasks repo a pull request, or you can add a task to download the logs from the previous task and parse out the url from there.
I provided the code to do that in a very similar, but not duplicate question:
https://stackoverflow.com/a/69995041/736079
Upvotes: 1