From fa57525093dbe0c278c42e7b211ea90a1a7719f7 Mon Sep 17 00:00:00 2001 From: hongwei Date: Fri, 9 Jan 2026 12:56:48 +0100 Subject: [PATCH] refactor/(run_all_tests.sh): enhance HTML report generation with asset copying - Update surefire report filename from surefire-report.html to surefire.html - Add copying of CSS, JS, images, fonts, and img directories for proper report rendering - Copy report assets for both obp-api and obp-commons modules - Add error suppression for missing asset directories to prevent script failures - Clarify alternative naming convention in site reports location comment - Ensure HTML reports render correctly with all required static assets --- run_all_tests.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/run_all_tests.sh b/run_all_tests.sh index 826b089d7..78fcaf3c1 100644 --- a/run_all_tests.sh +++ b/run_all_tests.sh @@ -833,16 +833,22 @@ if mvn surefire-report:report-only -DskipTests 2>&1 | tee -a "${DETAIL_LOG}"; th mkdir -p "${HTML_REPORT_DIR}" # Copy reports from both modules - if [ -f "obp-api/target/surefire-reports/surefire-report.html" ]; then - cp "obp-api/target/surefire-reports/surefire-report.html" "${HTML_REPORT_DIR}/obp-api-report.html" + if [ -f "obp-api/target/surefire-reports/surefire.html" ]; then + cp "obp-api/target/surefire-reports/surefire.html" "${HTML_REPORT_DIR}/obp-api-report.html" + # Also copy CSS, JS, images for proper rendering + cp -r "obp-api/target/surefire-reports/css" "${HTML_REPORT_DIR}/" 2>/dev/null || true + cp -r "obp-api/target/surefire-reports/js" "${HTML_REPORT_DIR}/" 2>/dev/null || true + cp -r "obp-api/target/surefire-reports/images" "${HTML_REPORT_DIR}/" 2>/dev/null || true + cp -r "obp-api/target/surefire-reports/fonts" "${HTML_REPORT_DIR}/" 2>/dev/null || true + cp -r "obp-api/target/surefire-reports/img" "${HTML_REPORT_DIR}/" 2>/dev/null || true log_message " - obp-api report: ${HTML_REPORT_DIR}/obp-api-report.html" fi - if [ -f "obp-commons/target/surefire-reports/surefire-report.html" ]; then - cp "obp-commons/target/surefire-reports/surefire-report.html" "${HTML_REPORT_DIR}/obp-commons-report.html" + if [ -f "obp-commons/target/surefire-reports/surefire.html" ]; then + cp "obp-commons/target/surefire-reports/surefire.html" "${HTML_REPORT_DIR}/obp-commons-report.html" log_message " - obp-commons report: ${HTML_REPORT_DIR}/obp-commons-report.html" fi - # Also check for site reports location + # Also check for site reports location (alternative naming) if [ -f "obp-api/target/site/surefire-report.html" ]; then cp "obp-api/target/site/surefire-report.html" "${HTML_REPORT_DIR}/obp-api-report.html" log_message " - obp-api report: ${HTML_REPORT_DIR}/obp-api-report.html"