Skip to content
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

Azure Pipelines: Upload test logs as artifacts #2575

Merged
merged 2 commits into from
Mar 4, 2022

Conversation

StephanTLavavej
Copy link
Member

@StephanTLavavej StephanTLavavej commented Feb 17, 2022

Fixes #2557.

  • Extend 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 with for failure_elem was the most elegant way to handle this optionality. I checked lit'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.
  • Remove dead logic - publishArtifact was disabled a year ago due to Azure Pipelines: 11 TiB of Pipeline Artifacts is excessive #1653.
  • Add a new publish step, that will upload test-results.xml. This is set to happen only if a previous step failed() (but not if the run is cancelled).
    • I've verified that this uploads artifacts for both compiletime and runtime failures, and they're easily downloadable as ZIP files. I've also verified that no artifacts are uploaded when a shard succeeds.

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.

@CaseyCarter CaseyCarter removed their assignment Feb 24, 2022
@barcharcraz barcharcraz removed their assignment Mar 4, 2022
@StephanTLavavej StephanTLavavej self-assigned this Mar 4, 2022
@StephanTLavavej
Copy link
Member Author

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 06514fc into microsoft:main Mar 4, 2022
@StephanTLavavej StephanTLavavej deleted the xml-logs branch March 4, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Related to repository automation test Related to test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure Pipelines: Investigate uploading test logs as artifacts
3 participants
  翻译: