-
Notifications
You must be signed in to change notification settings - Fork 19
chore(ci): add final_status property on junit XML [APMSP-2610] #1681
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
Merged
gh-worker-dd-mergequeue-cf854d
merged 3 commits into
main
from
cbeauchesne/final_status
Mar 10, 2026
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
|
|
||
| <!-- Identity transform: copy everything as-is by default --> | ||
| <xsl:template match="@*|node()"> | ||
| <xsl:copy> | ||
| <xsl:apply-templates select="@*|node()"/> | ||
| </xsl:copy> | ||
| </xsl:template> | ||
|
|
||
| <!-- For testcase elements missing dd_tags[test.final_status] inside their properties block --> | ||
| <xsl:template match="testcase[not(properties/property[@name='dd_tags[test.final_status]'])]"> | ||
| <xsl:copy> | ||
| <xsl:apply-templates select="@*"/> | ||
| <xsl:variable name="status"> | ||
| <xsl:choose> | ||
| <xsl:when test="failure or error">fail</xsl:when> | ||
| <xsl:when test="skipped">skip</xsl:when> | ||
| <xsl:otherwise>pass</xsl:otherwise> | ||
| </xsl:choose> | ||
| </xsl:variable> | ||
| <xsl:choose> | ||
| <xsl:when test="properties"> | ||
| <!-- Inject into existing properties block, preserving child order --> | ||
| <xsl:for-each select="node()"> | ||
| <xsl:choose> | ||
| <xsl:when test="self::properties"> | ||
| <properties> | ||
| <xsl:apply-templates select="@*|node()"/> | ||
| <property name="dd_tags[test.final_status]" value="{$status}"/> | ||
| </properties> | ||
| </xsl:when> | ||
| <xsl:otherwise> | ||
| <xsl:apply-templates select="."/> | ||
| </xsl:otherwise> | ||
| </xsl:choose> | ||
| </xsl:for-each> | ||
| </xsl:when> | ||
| <xsl:otherwise> | ||
| <!-- No properties block: create one before other children --> | ||
| <properties> | ||
| <property name="dd_tags[test.final_status]" value="{$status}"/> | ||
| </properties> | ||
| <xsl:apply-templates select="node()"/> | ||
| </xsl:otherwise> | ||
| </xsl:choose> | ||
| </xsl:copy> | ||
| </xsl:template> | ||
|
|
||
| </xsl:stylesheet> |
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
Oops, something went wrong.
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 a new step with a new way of modifying the junit.xml file, would it make more sense to incorporate it into the existing script we have that includes unit tests?
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.
Definitly. I confess that since I need to do so for 17 repos (and maybe more), I went for a solution that works everywhere and use it regardless of the existing scripts.
But if you'd like to see an implementation in rust, I can give it a try, but I will very probably need your help, since I never write a single line of rust (Claude, be ready 😄 )
Let me know what you prefer !
Uh oh!
There was an error while loading. Please reload this page.
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.
If this is a blocker for you, I'm ok merging it as is and we can follow up later to merge it into the existing script. I can probably handle making the change.