Add Attempt and JobAttempt options to json2junit#449
Merged
michelle-clayton-work merged 2 commits intomainfrom Apr 1, 2026
Merged
Add Attempt and JobAttempt options to json2junit#449michelle-clayton-work merged 2 commits intomainfrom
michelle-clayton-work merged 2 commits intomainfrom
Conversation
qmuntal
approved these changes
Mar 25, 2026
0b65a97 to
d95d783
Compare
Contributor
Author
d95d783 to
b4cf5a4
Compare
Add a JobAttempt field to json2junit.Options that, when set, appends an attempt label to JUnit test suite names (e.g. 'pkg [attempt 2]') to distinguish CI job-level reruns (System.StageAttempt in Azure DevOps). Ref: microsoft/go#2134
b4cf5a4 to
506529e
Compare
Member
|
/azp run microsoft-go-infra |
|
Azure Pipelines successfully started running 1 pipeline(s). |
dagood
approved these changes
Mar 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends json2junit so JUnit test suite names can be labeled with an attempt identifier, enabling CI systems to distinguish reruns when aggregating results.
Changes:
- Added
JobAttempttojson2junit.Options. - Appended an attempt suffix to JUnit
<testsuite name="...">during conversion whenJobAttemptis set. - Added a unit test to verify suite name labeling behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| json2junit/json2junit.go | Adds Options.JobAttempt and uses it to suffix JUnit suite names. |
| json2junit/json2junit_test.go | Adds a test that asserts the suite name includes the attempt label when configured. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
122ab23 to
9d3edaf
Compare
dagood
approved these changes
Mar 31, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Add Attempt and JobAttempt fields to json2junit.Options that, when set, append labels to JUnit test suite names to distinguish different kinds of retries:
Suite names are formatted as:
References: