Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/add_final_status.xsl
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>
14 changes: 12 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ jobs:
report_paths: "target/nextest/ci/junit.xml"
check_name: "[${{ matrix.platform }}:${{ matrix.rust_version }}] test report"
include_passed: true
- name: Add final_status property
if: success() || failure()
shell: bash
run: |
which xsltproc || sudo apt-get install -y xsltproc
xml_file="target/nextest/ci/junit.xml"
echo "Fixing $xml_file"
tmp_file="$(mktemp)"
xsltproc --output "$tmp_file" ".github/workflows/add_final_status.xsl" "$xml_file"
mv "$tmp_file" "$xml_file"
- name: Upload test results to Datadog
if: success() || failure()
shell: bash
Expand Down Expand Up @@ -165,13 +175,13 @@ jobs:
parametric:
needs:
- build-artifacts
uses: DataDog/system-tests/.github/workflows/run-parametric.yml@bafc8bc606d76170d98ce3cdb13c75a1ea9cf924 # main
uses: DataDog/system-tests/.github/workflows/run-parametric.yml@93283b322c59ecf7267c28c06648d341be75eded # main
secrets:
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DATADOG_API_KEY }}
with:
library: rust
binaries_artifact: system_tests_binaries
job_count: 2
job_matrix: '[1,2]'
ref: 8a65f66d74ca77f34e7e5a2f737e963ce9cec563 # main
ref: 93283b322c59ecf7267c28c06648d341be75eded # main
push_to_test_optimization: true
Loading