Skip to content

Commit

Permalink
[CI] Remove duplicated status. (#11285)
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
  • Loading branch information
1 parent 8c7402c commit 81a241b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 9 additions & 2 deletions tools/devops/automation/scripts/GitHub.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,18 @@ function New-GitHubSummaryComment {
Set-GitHubStatus -Status "failure" -Description "Tests failed catastrophically on $Context (no summary found)." -Context "$Context"
$request = New-GitHubComment -Header "Tests failed catastrophically on $Context (no summary found)." -Emoji ":fire:" -Description "Result file $TestSummaryPath not found. $headerLinks"
} else {

# set the context to be "pipeline name (Test run)", example xamarin-macios (Test run)
$statusContext = "$Env:BUILD_DEFINITIONNAME (Test run)"
if ($Context -ne "Build") { #special case when we deal with the device tests
$statusContext = "$Contex - $Env:BUILD_DEFINITIONNAME) (Test run)"
}

if (Test-JobSuccess -Status $Env:TESTS_JOBSTATUS) {
Set-GitHubStatus -Status "success" -Description "Tests passed on $Context." -Context "$Context"
Set-GitHubStatus -Status "success" -Description "All tests passed on $Context." -Context $statusContext
$request = New-GitHubCommentFromFile -Header "Tests passed on $Context." -Description "Tests passed on $Context. $headerLinks" -Emoji ":white_check_mark:" -Path $TestSummaryPath
} else {
Set-GitHubStatus -Status "failure" -Description "Tests failed on $Context." -Context "$Context"
Set-GitHubStatus -Status "error" -Description "Tests failed on $Context." -Context $statusContext
$request = New-GitHubCommentFromFile -Header "Tests failed on $Context" -Description "Tests failed on $Context. $headerLinks" -Emoji ":x:" -Path $TestSummaryPath
}
}
Expand Down
7 changes: 0 additions & 7 deletions tools/devops/automation/templates/build/publish-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,6 @@ steps:
$response = New-GitHubSummaryComment -Context "$Env:CONTEXT" -TestSummaryPath "$Env:TESTS_SUMMARY" -APIDiff "$Env:APIDIFF_JSON_PATH"
Write-Host $response
}
if($Env:TESTS_JOBSTATUS -ne "Succeeded")
{
Set-PipelineResult -Status partiallySucceeded
Set-GitHubStatus -Status "error" -Description "Some tests failed." -Context "$(Build.DefinitionName) (Test run)"
} else {
Set-GitHubStatus -Status "success" -Description "All tests passed." -Context "$(Build.DefinitionName) (Test run)"
}
env:
BUILD_REVISION: $(Build.SourceVersion)
CONTEXT: ${{ parameters.statusContext }}
Expand Down

0 comments on commit 81a241b

Please sign in to comment.