Skip to content

Pass attempt label to JUnit output to distinguish test retries#2209

Merged
michelle-clayton-work merged 9 commits intomicrosoft/mainfrom
dev/mclayton/sep-attempts
Apr 4, 2026
Merged

Pass attempt label to JUnit output to distinguish test retries#2209
michelle-clayton-work merged 9 commits intomicrosoft/mainfrom
dev/mclayton/sep-attempts

Conversation

@michelle-clayton-work
Copy link
Copy Markdown
Contributor

@michelle-clayton-work michelle-clayton-work commented Mar 23, 2026

Followup PR to microsoft/go-infra#449

  • Add -attempt flag to run-builder, passed through to json2junit
  • Each retry attempt writes a unique JUnit XML file (TestResults-attempt-N.xml)
  • Publish all attempt files via wildcard in PublishTestResults
  • Update go-infra dependency to pick up Attempt support in json2junit

This ensures test result entries in AzDO distinguish which attempt they correspond to, both via unique file names and via the attempt label embedded in JUnit test suite names.

Fixes: #2134

@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch 3 times, most recently from 4d6827e to ea7101d Compare March 24, 2026 22:41
@dagood
Copy link
Copy Markdown
Member

dagood commented Mar 25, 2026

Fixes: #2134

GitHub quirk: if you put this in a list (without changing anything else), GitHub grabs the issue title. I do this basically always--more immediately readable and makes it obvious when I've grabbed the wrong issue.

* Fixes: #2134

@michelle-clayton-work
Copy link
Copy Markdown
Contributor Author

michelle-clayton-work commented Mar 26, 2026

image

Add -attempt and -jobattempt flags to run-builder, passed through to
json2junit. This distinguishes test results along two retry dimensions:

- System.JobAttempt (AzDO job-level rerun): passed as -jobattempt
- retryAttempts loop (in-job test retry): passed as -attempt

All retry attempts are published in a single test run with title:
  'linux-amd64 test (ubuntu) (job attempt 2)'

Suite names inside the XML distinguish retries:
  'cmd/go [job attempt 2, retry 3]'

Includes a temporary forced flake on attempt 1 for testing retry
visibility (marked with TODO for removal).

Fixes: #2134
@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch 3 times, most recently from e9de3e8 to d4760ed Compare March 27, 2026 19:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Azure DevOps test result reporting for retried test runs by ensuring each retry produces distinct JUnit output and by passing a CI attempt label through to the JUnit converter (via updated go-infra support).

Changes:

  • Emit per-retry JUnit XML files (TestResults-attempt-*.xml) and publish them via wildcard.
  • Pass a CI attempt label (-jobattempt, currently wired to $(System.StageAttempt)) through run-builder into json2junit options.
  • Bump github.com/microsoft/go-infra dependency to pick up Attempt/JobAttempt support in json2junit.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
eng/pipeline/stages/run-stage.yml Write unique JUnit XML per retry attempt; publish all attempt files; pass CI attempt label; adjust artifact naming/title.
eng/_util/buildutil/testjson.go Add -jobattempt flag and forward it into json2junit options.
eng/_util/go.mod Update go-infra dependency version.
eng/_util/go.sum Update go-infra checksums for the new version.

michelle-clayton-work and others added 4 commits April 1, 2026 23:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@michelle-clayton-work
Copy link
Copy Markdown
Contributor Author

/azp help

@azure-pipelines
Copy link
Copy Markdown

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@michelle-clayton-work
Copy link
Copy Markdown
Contributor Author

/azp where

@azure-pipelines
Copy link
Copy Markdown

Azure DevOps orgs getting events for this repository:

Copy link
Copy Markdown
Member

@dagood dagood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a test run with a simulated failure showing what job/stage attempts look like with this change? I'm not quite sure how it'll show up, and why/when to use jobattempt vs. testRunTitle.

@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch 2 times, most recently from e9e14f9 to da97858 Compare April 3, 2026 02:31
@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch from da97858 to 01314bc Compare April 3, 2026 20:08
@michelle-clayton-work michelle-clayton-work force-pushed the dev/mclayton/sep-attempts branch from 7914c07 to 90db8ad Compare April 3, 2026 23:00
@michelle-clayton-work michelle-clayton-work merged commit 3dfe6c9 into microsoft/main Apr 4, 2026
57 checks passed
@michelle-clayton-work michelle-clayton-work deleted the dev/mclayton/sep-attempts branch April 4, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make test results distinguish the attempt

3 participants