Skip to content

Avoid sending status email if no error#29284

Merged
vidai-msft merged 1 commit intomainfrom
vidai/livetest
Mar 20, 2026
Merged

Avoid sending status email if no error#29284
vidai-msft merged 1 commit intomainfrom
vidai/livetest

Conversation

@vidai-msft
Copy link
Contributor

Description

This pull request makes minor adjustments to the output and reporting logic in the live test PowerShell scripts, primarily to clean up messaging and simplify the email notification logic.

  • Output and Messaging Improvements:

    • In InvokeLiveTestScenarios.ps1, the [Test Scenario Result] label was removed from the section header in the output message for live test runs, making the output more concise.
  • Email Reporting Logic:

    • In SendLiveTestReport.ps1, the branch that sent a "no errors" email when there were no test errors was removed. Now, emails are only sent if there are actual errors to report, reducing unnecessary notifications.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Copilot AI review requested due to automatic review settings March 19, 2026 13:49
@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the live test reporting experience in tools/TestFx/Live by simplifying console output and reducing email notifications to only error cases.

Changes:

  • Remove the “no errors” email path so emails are only sent when live test failures exist.
  • Simplify the Azure Pipelines section header text emitted during per-module live test execution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tools/TestFx/Live/SendLiveTestReport.ps1 Only sends the email report when $errorsArr contains failures; removes the “no errors” email content branch.
tools/TestFx/Live/InvokeLiveTestScenarios.ps1 Shortens the per-module section header output by removing the [Test Scenario Result] label.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 88 to +92
if ($errorsArr.Count -gt 0) {
$emailContent = $errorsArr | Sort-Object OSVersion, PSVersion, Module, Name | ConvertTo-Html -Property OSVersion, PSVersion, Module, Name, Exception, RetryException -Head $css -Title "Azure PowerShell Live Test Report" -PreContent "$summarySection<h1>Live Test Error Details</h1>"
}
else {
$emailContent = "<html><head>$css</head><body>$summarySection<div>No live test errors reported. Please check the overall status from Azure pipeline.</div></body></html>"
}

Send-EmailServiceMail -To "${env:EMAILTO}" -Subject $emailSubject -Content $emailContent -IsHtml
Send-EmailServiceMail -To "${env:EMAILTO}" -Subject $emailSubject -Content $emailContent -IsHtml
}
@vidai-msft vidai-msft merged commit e0f492f into main Mar 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants