-
Notifications
You must be signed in to change notification settings - Fork 45
Also fail on Pester block/container failures (not just failed tests) #663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -94,16 +94,18 @@ $summary = @" | |||||
| | Total | $($result.TotalCount) | | ||||||
| | Passed | $($result.PassedCount) | | ||||||
| | Failed | $($result.FailedCount) | | ||||||
| | Failed Blocks | $($result.FailedBlocksCount) | | ||||||
| | Failed Containers | $($result.FailedContainersCount) | | ||||||
| | Skipped | $($result.SkippedCount) | | ||||||
| | Duration | $($result.Duration) | | ||||||
| "@ | ||||||
|
|
||||||
| Write-CIStepSummary $summary | ||||||
|
|
||||||
| Set-CIOutput -Name 'test-result' -Value $(if ($result.FailedCount -eq 0) { 'passed' } else { 'failed' }) | ||||||
| Set-CIOutput -Name 'test-result' -Value $(if (($result.FailedCount + $result.FailedBlocksCount + $result.FailedContainersCount) -eq 0) { 'passed' } else { 'failed' }) | ||||||
| Set-CIOutput -Name 'test-count' -Value $result.TotalCount.ToString() | ||||||
| Set-CIOutput -Name 'fail-count' -Value $result.FailedCount.ToString() | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consistency (non-blocking): Set-CIOutput -Name 'fail-count' -Value (($result.FailedCount + $result.FailedBlocksCount + $result.FailedContainersCount)).ToString()
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pls repost the suggestions as actual suggestions and not just code blocks so they can be applied.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something like this?
Suggested change
@katriendg @WilliamBerryiii @bindsi @agreaves-ms Have we considered |
||||||
|
|
||||||
| if ($CI -and $result.FailedCount -gt 0) { | ||||||
| if ($CI -and ($result.FailedCount + $result.FailedBlocksCount + $result.FailedContainersCount) -gt 0) { | ||||||
| exit 1 | ||||||
|
Comment on lines
+109
to
110
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reliability / developer UX (non-blocking) — relates to Now that the build fails on block/container failures, there's a gap: foreach ($container in $result.Containers) {
if ($container.Result -eq 'Failed') {
Write-CIAnnotation -Level 'Error' `
-Message "Container failed to run: $($container.Item) — $($container.ErrorRecord.Exception.Message)" `
-File $container.Item
}
}
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pls repost the suggestions as actual suggestions and not just code blocks so they can be applied. |
||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency (non-blocking) — relates to
test-summary.jsongeneration just above this hunk (lines 78-79).The markdown table now surfaces
FailedBlocksCount/FailedContainersCount, but the persistedtest-summary.jsonstill selects onlyFailedCount, so the uploaded artifact disagrees with this table and the gate. Consider adding the two new counters there as well:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pls repost the suggestions as actual suggestions and not just code blocks so they can be applied.