From 42b02a67576b231254fc4bc71ec410d56ace8e3c Mon Sep 17 00:00:00 2001 From: Marvin Froeder Date: Wed, 3 Dec 2025 16:15:19 -0300 Subject: [PATCH] Redirect test output to file and print reports in CI Signed-off-by: Marvin Froeder --- .circleci/config.yml | 10 ++++++++++ .circleci/print-test-reports.sh | 29 +++++++++++++++++++++++++++++ pom.xml | 9 +++++---- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100755 .circleci/print-test-reports.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c77ccfd06..5dfe9741fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,9 +111,18 @@ commands: de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies \ -T3 + print-test-reports: + description: "Print test output files for debugging" + steps: + - run: + name: Print test output files + command: ./.circleci/print-test-reports.sh + when: always + save-test-results: description: "Save test results and upload to Codecov" steps: + - print-test-reports - run: name: Save package results command: | @@ -291,6 +300,7 @@ jobs: -pl :sqrl-testing-container \ -Ddocker.image.tag=local-${CIRCLE_SHA1} \ -Dmcp.inspector.version=$MCP_TAG + - save-test-results deploy: docker: diff --git a/.circleci/print-test-reports.sh b/.circleci/print-test-reports.sh new file mode 100755 index 0000000000..14759e4b1a --- /dev/null +++ b/.circleci/print-test-reports.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +for report_dir in $(find . -type d -path "*/target/surefire-reports" -o -path "*/target/failsafe-reports" 2>/dev/null); do + if [ -d "$report_dir" ]; then + for file in "$report_dir"/*.txt; do + if [ -f "$file" ] && [[ ! "$file" =~ -output\.txt$ ]]; then + test_name=$(basename "$file" .txt) + + echo "" + echo "==== START: $test_name ====" + echo "FILE: $file" + echo "" + cat "$file" + + output_file="${file%.txt}-output.txt" + if [ -f "$output_file" ]; then + echo "" + echo "Console Output:" + cat "$output_file" + fi + + echo "" + echo "==== END: $test_name ====" + echo "" + fi + done + fi +done + diff --git a/pom.xml b/pom.xml index ca0a8947c5..ecd737ecce 100644 --- a/pom.xml +++ b/pom.xml @@ -176,6 +176,7 @@ 3.2.8 3.12.0 3.4.0 + 3.5.4 4.0.0 @@ -947,8 +948,9 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.4 + ${maven-surefire-plugin.version} + true **/*Test.java @@ -960,8 +962,9 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.4 + ${maven-surefire-plugin.version} + true **/*IT.java @@ -1316,14 +1319,12 @@ maven-surefire-plugin false - true maven-failsafe-plugin false - true 1