Azure Pipelines: Upload test logs as artifacts #2575
Merged
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.
Fixes #2557.
tools/scripts/print_failures.py
to understand the XML produced by--xunit-xml-output
. This detects.xml
versus any other extension and acts accordingly. Like the JSON codepath, success is silence. Note that a"testcase"
element can have 0 or 1"failure"
elements; looping withfor failure_elem
was the most elegant way to handle this optionality. I checkedlit
's generation logic to make sure that I wasn't missing any potential forms of output (AFAICT, both unexpected failures and unexpected passes are reported with"failure"
here.) The CRLF replacement needed for JSON doesn't appear to be needed for XML.publishArtifact
was disabled a year ago due to Azure Pipelines: 11 TiB of Pipeline Artifacts is excessive #1653.publish
step, that will uploadtest-results.xml
. This is set to happen only if a previous stepfailed()
(but not if the run is cancelled).We'll still be able to rely on the error output that's immediately visible in Azure Pipelines for most failures, but if we encounter lengthy output (in scenarios like #2449, or for header units where the command lines are extremely long), then the XML output will be available for easy investigation.