From ce9241109dad10f64ee5793c93bf81aabfa9fba6 Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:44:35 +0100 Subject: [PATCH 1/5] ci(test): report bats results with the shared test-report action Replace the third-party JUnit reporter with the shared test-report action and drop checks: write. Refs #214 --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d574a73..b2289a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ concurrency: permissions: contents: read - checks: write jobs: test: @@ -48,13 +47,12 @@ jobs: ./tests/bash/run-tests.sh --ci - name: Publish test results - uses: mikepenz/action-junit-report@4a26df3e2ae132254ba12a53f65a388d0961e786 # v6.7.0 + # Pre-release trial of DevSecNinja/.github#604; pin a release before merging. + uses: DevSecNinja/.github/actions/test-report@7046a8eade60b1acdac3e3df6d39b122e007eed8 # test-report trial if: always() with: - report_paths: "tests/bash/test-results.xml" - check_name: Bats Test Results - detailed_summary: true - include_passed: true + paths: tests/bash/test-results.xml + title: Bats tests - name: Upload test results artifact uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 From 82fcfe946effcf4a153fc52654fbb50e5bce784a Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:48:14 +0100 Subject: [PATCH 2/5] test: temporary failing bats test to demo the test report --- tests/bash/report-trial.bats | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/bash/report-trial.bats diff --git a/tests/bash/report-trial.bats b/tests/bash/report-trial.bats new file mode 100644 index 0000000..7744994 --- /dev/null +++ b/tests/bash/report-trial.bats @@ -0,0 +1,7 @@ +#!/usr/bin/env bats + +# Temporary: deliberate failure to demo the test-report action (#214). Reverted before review. +@test "report trial: deliberate failure" { + run echo hello + [ "$output" = "goodbye" ] +} From e9a8826dcf74dd02daeeac0a719346210ee54416 Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:53:13 +0100 Subject: [PATCH 3/5] fix(test): keep the JUnit report when bats tests fail --- .github/workflows/ci.yml | 2 +- tests/bash/run-tests.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2289a1..77004d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: Publish test results # Pre-release trial of DevSecNinja/.github#604; pin a release before merging. - uses: DevSecNinja/.github/actions/test-report@7046a8eade60b1acdac3e3df6d39b122e007eed8 # test-report trial + uses: DevSecNinja/.github/actions/test-report@70e5c20882c5763cd3939e5d33d8be7eb2ae9bc2 # test-report trial if: always() with: paths: tests/bash/test-results.xml diff --git a/tests/bash/run-tests.sh b/tests/bash/run-tests.sh index 768d233..b2de8fa 100755 --- a/tests/bash/run-tests.sh +++ b/tests/bash/run-tests.sh @@ -173,8 +173,9 @@ if [ "${CI_MODE}" = true ]; then # Run with pretty terminal output and a separate JUnit report file # --report-formatter writes JUnit XML to --output directory REPORT_DIR="$(dirname "${OUTPUT_FILE}")" - bats --formatter tap --report-formatter junit --output "${REPORT_DIR}" "${TEST_FILES[@]}" - EXIT_CODE=$? + # set -e would exit on failing tests before the report is renamed. + EXIT_CODE=0 + bats --formatter tap --report-formatter junit --output "${REPORT_DIR}" "${TEST_FILES[@]}" || EXIT_CODE=$? # Rename the report file to the expected output filename if [ -f "${REPORT_DIR}/report.xml" ]; then mv "${REPORT_DIR}/report.xml" "${OUTPUT_FILE}" From 8f9743a86f4c404494bd4c0d6ace01d94739c34f Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:56:26 +0100 Subject: [PATCH 4/5] test: remove the temporary failing bats test --- tests/bash/report-trial.bats | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/bash/report-trial.bats diff --git a/tests/bash/report-trial.bats b/tests/bash/report-trial.bats deleted file mode 100644 index 7744994..0000000 --- a/tests/bash/report-trial.bats +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bats - -# Temporary: deliberate failure to demo the test-report action (#214). Reverted before review. -@test "report trial: deliberate failure" { - run echo hello - [ "$output" = "goodbye" ] -} From bdcd353b9bc980b4dbaf196ef776d64bb7c0b7da Mon Sep 17 00:00:00 2001 From: Jean-Paul van Ravensberg <14926452+DevSecNinja@users.noreply.github.com> Date: Fri, 20 Nov 2026 10:59:23 +0100 Subject: [PATCH 5/5] ci(test): repin the test-report trial to the reviewed head --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77004d2..3aed1b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: - name: Publish test results # Pre-release trial of DevSecNinja/.github#604; pin a release before merging. - uses: DevSecNinja/.github/actions/test-report@70e5c20882c5763cd3939e5d33d8be7eb2ae9bc2 # test-report trial + uses: DevSecNinja/.github/actions/test-report@b558c78a4d9e175874ebf5bf953e60da27d5215e # test-report trial if: always() with: paths: tests/bash/test-results.xml