yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [yetus] branch master updated: YETUS-904. junit report doesn't work properly under --docker (#72)
Date Sun, 18 Aug 2019 20:34:59 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 79decad  YETUS-904. junit report doesn't work properly under --docker (#72)
79decad is described below

commit 79decadda42820639c7a63d29c482ff4687047ea
Author: Allen Wittenauer <aw@apache.org>
AuthorDate: Sun Aug 18 13:34:54 2019 -0700

    YETUS-904. junit report doesn't work properly under --docker (#72)
    
    Signed-off-by: Sean Busbey <busbey@apache.org>
---
 precommit/src/main/shell/test-patch.d/junit.sh | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/precommit/src/main/shell/test-patch.d/junit.sh b/precommit/src/main/shell/test-patch.d/junit.sh
index a5215db..28fa60d 100755
--- a/precommit/src/main/shell/test-patch.d/junit.sh
+++ b/precommit/src/main/shell/test-patch.d/junit.sh
@@ -48,10 +48,19 @@ function junit_parse_args
       ;;
       --junit-report-xml=*)
         delete_parameter "${i}"
-        JUNIT_REPORT_XML=${i#*=}
+        fn=${i#*=}
       ;;
     esac
   done
+
+  if [[ -n "${fn}" ]]; then
+    if : > "${fn}"; then
+      JUNIT_REPORT_XML_ORIG="${fn}"
+      JUNIT_REPORT_XML=$(yetus_abs "${JUNIT_REPORT_XML_ORIG}")
+    else
+      yetus_error "WARNING: cannot create JUnit XML report file ${fn}. Ignoring."
+    fi
+  fi
 }
 
 function junit_process_tests
@@ -105,6 +114,18 @@ function junit_finalize_results
   fi
 }
 
+## @description  Give access to the junit report file in docker mode
+## @audience     private
+## @stability    evolving
+## @replaceable  no
+function junit_docker_support
+{
+  if [[ -n ${JUNIT_REPORT_XML} ]]; then
+    DOCKER_EXTRAARGS+=("-v" "${JUNIT_REPORT_XML}:${DOCKER_WORK_DIR}/junit.xml")
+    USER_PARAMS+=("--junit-report-xml=${DOCKER_WORK_DIR}/junit.xml")
+  fi
+}
+
 ## @description  Only print selected information to a report file
 ## @audience     private
 ## @stability    evolving
@@ -213,4 +234,4 @@ EOF
 
   echo "</testsuite>" >> "${JUNIT_REPORT_XML}"
   echo "</testsuites>" >> "${JUNIT_REPORT_XML}"
-}
\ No newline at end of file
+}


Mime
View raw message