-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Plumb test failures through to github #15831
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
169bd1c
trying something out
zadjii-msft 848fbb8
this'll work for sure
zadjii-msft df95d24
this might be load bearing
zadjii-msft b935a6a
the old college try
zadjii-msft 73dc549
Merge remote-tracking branch 'origin/main' into dev/migrie/some-tests…
zadjii-msft 4a8d50d
oh yea
zadjii-msft 8a0b322
clean up comments
zadjii-msft 8f03ee6
Update build/Helix/HelixTestHelpers.cs
zadjii-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$XUnitOutputPath | ||
) | ||
|
||
# This script is used to parse the XUnit output from the test runs and print out | ||
# the tests that failed. | ||
# | ||
# Why you might ask? Well, it sure seems like Azure DevOps doesn't like the fact | ||
# that we just call our tests in a powershell script. It can't seemingly find | ||
# the actual errors in the TAEF logs. That means when you just go to the | ||
# "Checks" page on GitHub, the Azure DevOps integration doesn't have anything | ||
# meaningful to say other than "PowerShell exited with code '1'". If we however, | ||
# just manually emit the test names formatted with "#[error]" in front of them, | ||
# well, then the integration will all work like magic. | ||
|
||
# Load the test results as a XML object | ||
$testResults = [xml](Get-Content -Path $XUnitOutputPath) | ||
|
||
# Our XML looks like: | ||
# <assemblies> | ||
# <assembly name="MUXControls.Test.dll" test-framework="TAEF" run-date="2023-08-14" run-time="11:38:01" total="524" passed="520" failed="4" skipped="1" time="8943" errors="0"> | ||
# <collection total="524" passed="520" failed="4" skipped="1" name="Test collection" time="8943"> | ||
# <test name="ControlCoreTests::TestSimpleClickSelection" type="ControlCoreTests" method="TestSimpleClickSelection" time="0.016" result="Fail"> | ||
|
||
# Iterate over all the assemblies and print all the tests that failed | ||
foreach ($assembly in $testResults.assemblies.assembly) { | ||
foreach ($collection in $assembly.collection) { | ||
foreach ($test in $collection.test) { | ||
if ($test.result -eq "Fail") { | ||
# This particular format is taken from the Azure DevOps documentation: | ||
# https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md | ||
# This will treat this line as an error message | ||
Write-Output "##vso[task.logissue type=error]$($test.name) Failed" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: This could be an enum to make the
if()
/if(!)
code a bit simpler.