-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[ci] Publish test results #23477
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
Closed
Closed
[ci] Publish test results #23477
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b699c66
Publish CI test results
dg0yt bf66a5b
Process xunit file for AZP
dg0yt 0c27a88
Simulate build error for testing
dg0yt 710ab24
Merge remote-tracking branch 'origin/master' into test-results
dg0yt ed4585c
Restore xunit output and update result processing
dg0yt 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: MIT | ||
| # | ||
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Process the raw xUnit result file from vcpkg tool for uploading to AZP. | ||
|
|
||
| .DESCRIPTION | ||
| process-test-result takes the path a xUnit file generated by `vcpkg ci` and | ||
| modifies it in-place for reporting port builds as tests in Azure pipelines. | ||
|
|
||
| .PARAMETER xunit | ||
| The path to the xUnit file. | ||
| #> | ||
| [CmdletBinding()] | ||
| Param( | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$xunit | ||
| ) | ||
|
|
||
| if (-not(Test-Path $xunit)) { | ||
| write-error "No such file: $xunit" | ||
| } | ||
|
|
||
| # Fix invalid XML | ||
| (Get-Content -Path $xunit -Raw) ` | ||
| -replace ' method="(Skip|Fail|Pass)">', ' result="$1">' ` | ||
| -replace '</failure></message>', '</message></failure>' | | ||
| Set-Content -Path $xunit | ||
|
|
||
| [xml]$xmlContents = Get-Content $xunit | ||
| $node = $xmlContents.SelectSingleNode('/assemblies/assembly[@run-date="1970-01-01"]') | ||
| while ($null -ne $node) { | ||
| $node.ParentNode.RemoveChild($node) | Out-Null | ||
| $node = $xmlContents.SelectSingleNode('/assemblies/assembly[@run-date="1970-01-01"]') | ||
| } | ||
| $xmlContents.save($xunit) | ||
This file contains hidden or 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 hidden or 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
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.
Instead of adding yet another .ps1 that we wash output through can we just fix https://github.com/microsoft/vcpkg-tool/blob/29206722417f9b5ec3d1c1123c96776cd355e633/src/vcpkg/commands.ci.cpp#L218 to emit output that does the right thing?
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.
I believe the changes are:
Other than the EXCLUDED one I think it's clear we should always just do that, and for the excluded one it would be easy to add an additional --xunit-without-excluded thing or something like that?
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.
I can move it to vcpkg-tool once there is enough support for how to represent the data. This PR is the playground for direct testing of changes. I cannot do that with vpckg-tool PRs.
And it needs to wait at least for microsoft/vcpkg-tool#345 to be merged.
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.
I see, in that case this looks great, thank you!
I agree we need an easier way to test full e2e integration including a build. Unfortunately I don't know a way to set things up such that people can try changes from the internet directly; perhaps we can put in a switch in the .yml which chooses to build instead of bootstrap.
Does it? The only interesting thing your script consumes is parent hashes and the tool already consumes those.
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.
Hmmm apparently I don't understand what the intended effect of parent hashes is because I'm seeing ones that are in the parent survive processing here.
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.
Also this is duplicating assembly/collection for every test, is that the intent?
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.
Ah, I see, because the current analyze-test-results.ps1 is implemented in terms of that XUnit output.
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.
As written in source and PR comments: The xunit assemby name is the AZP "Test file" name. I found it useful to have the port name in this field.