This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 77c17dfdcf HDDS-11551. Provide details about integration check failure 
(#7294)
77c17dfdcf is described below

commit 77c17dfdcf73a06507bfbe885a44752c23d9808c
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Thu Oct 10 12:42:45 2024 +0200

    HDDS-11551. Provide details about integration check failure (#7294)
---
 .github/workflows/ci.yml                           |  6 +++-
 .../dev-support/checks/_mvn_unit_report.sh         | 38 ++++++++++++++--------
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3161d3b69d..997c0104df 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -549,7 +549,11 @@ jobs:
         env:
           DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
       - name: Summary of failures
-        run: hadoop-ozone/dev-support/checks/_summary.sh target/${{ github.job 
}}/summary.txt
+        run: |
+          if [[ -s "target/${{ github.job }}/summary.md" ]]; then
+            cat target/${{ github.job }}/summary.md >> $GITHUB_STEP_SUMMARY
+          fi
+          hadoop-ozone/dev-support/checks/_summary.sh target/${{ github.job 
}}/summary.txt
         if: ${{ !cancelled() }}
       - name: Archive build results
         uses: actions/upload-artifact@v4
diff --git a/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh 
b/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
index 36205c69bb..0249c7a498 100755
--- a/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
+++ b/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
@@ -29,16 +29,20 @@ _realpath() {
 tempfile="${REPORT_DIR}/summary.tmp"
 
 ## generate summary txt file
+failures=${REPORT_DIR}/failures.txt
 find "." -not -path '*/iteration*' -name 'TEST*.xml' -print0 \
     | xargs -n1 -0 "grep" -l -E "<failure|<error" \
     | awk -F/ '{sub("'"TEST-"'",""); sub(".xml",""); print $NF}' \
-    > "${tempfile}"
+    > "${failures}"
+cat ${failures} > "${tempfile}"
 
+leaks=${REPORT_DIR}/leaks.txt
 if [[ "${CHECK:-unit}" == "integration" ]]; then
   find hadoop-ozone/integration-test -not -path '*/iteration*' -name 
'*-output.txt' -print0 \
       | xargs -n1 -0 "grep" -l -E "not closed properly|was not shutdown 
properly" \
       | awk -F/ '{sub("-output.txt",""); print $NF}' \
-      >> "${tempfile}"
+      > "${leaks}"
+  cat ${leaks} >> "${tempfile}"
 fi
 
 #Copy heap dump and dump leftovers
@@ -50,11 +54,13 @@ find "." -not -path '*/iteration*' \
   -exec mv {} "$REPORT_DIR/" \;
 
 ## Add the tests where the JVM is crashed
+crashes=${REPORT_DIR}/crashes.txt
 grep -A1 'Crashed tests' "${REPORT_DIR}/output.log" \
   | grep -v -e 'Crashed tests' -e '--' \
   | cut -f2- -d' ' \
   | sort -u \
-  >> "${tempfile}"
+  > "${crashes}"
+cat "${crashes}" >> "${tempfile}"
 
 # Check for tests that started but were not finished
 if grep -q 'There was a timeout.*in the fork' "${REPORT_DIR}/output.log"; then
@@ -93,20 +99,24 @@ fi
 
 ## generate summary markdown file
 export SUMMARY_FILE="$REPORT_DIR/summary.md"
-for TEST_RESULT_FILE in $(find "$REPORT_DIR" -name "*.txt" | grep -v output); 
do
-
-    FAILURES=$(grep FAILURE "$TEST_RESULT_FILE" | grep "Tests run" | awk 
'{print $18}' | sort | uniq)
+echo -n > "$SUMMARY_FILE"
+if [ -s "${failures}" ]; then
+  printf "# Failed Tests\n\n" >> "$SUMMARY_FILE"
+  cat "${failures}" | sed 's/^/ * /' >> "$SUMMARY_FILE"
+fi
+rm -f "${failures}"
 
-    for FAILURE in $FAILURES; do
-        TEST_RESULT_LOCATION="$(_realpath --relative-to="$REPORT_DIR" 
"$TEST_RESULT_FILE")"
-        TEST_OUTPUT_LOCATION="${TEST_RESULT_LOCATION//.txt/-output.txt}"
-        printf " * [%s](%s) ([output](%s))\n" "$FAILURE" 
"$TEST_RESULT_LOCATION" "$TEST_OUTPUT_LOCATION" >> "$SUMMARY_FILE"
-    done
-done
+if [[ -s "${leaks}" ]]; then
+  printf "# Leaks Detected\n\n" >> "$SUMMARY_FILE"
+  cat "${leaks}" | sed 's/^/ * /' >> "$SUMMARY_FILE"
+fi
+rm -f "${leaks}"
 
-if [ -s "$SUMMARY_FILE" ]; then
-   printf "# Failing tests: \n\n" | cat - "$SUMMARY_FILE" > temp && mv temp 
"$SUMMARY_FILE"
+if [[ -s "${crashes}" ]]; then
+  printf "# Crashed Tests\n\n" >> "$SUMMARY_FILE"
+  cat "${crashes}" | sed 's/^/ * /' >> "$SUMMARY_FILE"
 fi
+rm -f "${crashes}"
 
 ## generate counter
 wc -l "$REPORT_DIR/summary.txt" | awk '{print $1}'> "$REPORT_DIR/failures"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to