From 096783e53af217fdf788b74edf5112831337ee84 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Mon, 9 Mar 2026 17:21:43 +0100 Subject: [PATCH 1/3] chore(ci): add final_status property on junit XML [APMSP-2610] --- .github/workflows/add_final_status.xsl | 50 ++++++++++++++++++++++++++ .github/workflows/dev.yml | 22 ++++++++++-- 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/add_final_status.xsl diff --git a/.github/workflows/add_final_status.xsl b/.github/workflows/add_final_status.xsl new file mode 100644 index 00000000..c515dfed --- /dev/null +++ b/.github/workflows/add_final_status.xsl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + fail + skip + pass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 3857068d..8e3ff2f4 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -66,7 +66,17 @@ jobs: run: cd ${BUILD_DIR} && test/tests -r junit -o report.xml env: ASAN_OPTIONS: alloc_dealloc_mismatch=0 + - name: Add final_status property + if: success() || failure() + run: | + which xsltproc || sudo apt-get install -y xsltproc + xml_file=".build/report.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 report to Datadog + if: success() || failure() run: | curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-${{ matrix.arch }}" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci datadog-ci junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp .build/report.xml @@ -145,7 +155,7 @@ jobs: Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH - name: Install Dependencies - run: scoop install main/cmake@4.0.1 main/ninja + run: scoop install main/cmake@4.0.1 main/ninja main/libxslt - name: Build run: | & 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }} @@ -155,10 +165,18 @@ jobs: run: | & 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }} .\build\test\tests.exe -r junit -o report.xml + - name: Add final_status property + if: success() || failure() + run: | + $xml_file = "report.xml" + $tmp_file = [System.IO.Path]::GetTempFileName() + xsltproc --output $tmp_file ".github/workflows/add_final_status.xsl" $xml_file + Move-Item -Force $tmp_file $xml_file - name: Upload test report to Datadog + if: success() || failure() run: | Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe" - ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml + ./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml coverage: needs: build-linux-cmake From 3609152d0bcc7454473832d629ab226cafa4ae07 Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Mon, 9 Mar 2026 17:39:53 +0100 Subject: [PATCH 2/3] remove useless sudo --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8e3ff2f4..06147db1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -69,7 +69,7 @@ jobs: - name: Add final_status property if: success() || failure() run: | - which xsltproc || sudo apt-get install -y xsltproc + which xsltproc || apt-get install -y xsltproc xml_file=".build/report.xml" echo "Fixing $xml_file" tmp_file="$(mktemp)" From 45ea450ea4abb760341f2b1d36ef40a9aebd4c5e Mon Sep 17 00:00:00 2001 From: Charles de Beauchesne Date: Mon, 9 Mar 2026 17:47:04 +0100 Subject: [PATCH 3/3] apt-get update --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 06147db1..602e16ad 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -69,7 +69,7 @@ jobs: - name: Add final_status property if: success() || failure() run: | - which xsltproc || apt-get install -y xsltproc + which xsltproc || (apt-get update && apt-get install -y xsltproc) xml_file=".build/report.xml" echo "Fixing $xml_file" tmp_file="$(mktemp)"