Reputation: 10213
We're using Azure DevOps to run a nightly build that checks our tests results. Our tests are decorated with Owner attribute (MSTest) of the test's owner name.
What is the simplest way to auto send email to the owner of the failing tests as part of the nightly run?
Can this functionality be achieved by using some built-in feature of Azure DevOps? If not, which custom flow can be integrated to the nightly build to achieve this?
Upvotes: 2
Views: 1231
Reputation: 51143
There is no such build-in feature in Azure DevOps for now.
Please take a look at similar question here: How to send a detailed email to specific developer from Azure DevOps on failure of unit tests from a Build pipeline?
As workaround, we could use a powershell script to get test results with REST API then send emails:
To get test results with RESI API Releases - Get Task Log:
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version=5.0-preview.2
Then use powershell scripts to read the details of the test result file (.trx) and create a formatted email message to sent to the defined recipients:
You could check this thread Send Test Result Email After Running Automated Tests with Release Management for some details.
There is also an Email Report Extension could handle e-mail related things in pipeline.
Upvotes: 2