]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
run-make-check.sh: let ctest generate XML output 40405/head
authorKefu Chai <kchai@redhat.com>
Thu, 25 Mar 2021 09:08:48 +0000 (17:08 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 25 Mar 2021 11:40:04 +0000 (19:40 +0800)
to enable XUnit plugin of jenkins to consume the ctest output and
publish it in the dashboard, we need to

* let ctest generate XML output instead of plain text output
* do not fail the test if any test case fails. this allows the publisher
  to do its job by checking the XML output.
* prevent ctest from compressing the output. see
  https://issues.jenkins.io/browse/JENKINS-21737

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 48ba39987d3958531589d7969750ea749e6a6d30)

run-make-check.sh

index 3a7451c54e7f063c69a972e247a4c57e714d5193..896d2f634838be4b46eaf4ce07081e9a9c22c999 100755 (executable)
@@ -22,6 +22,10 @@ source src/script/run-make.sh
 
 set -e
 
+function in_jenkins() {
+    test -n "$JENKINS_HOME"
+}
+
 function run() {
     # to prevent OSD EMFILE death on tests, make sure ulimit >= 1024
     $DRY_RUN ulimit -n $(ulimit -Hn)
@@ -35,9 +39,16 @@ function run() {
     $DRY_RUN sudo /sbin/sysctl -q -w fs.aio-max-nr=$((65536 * 16))
 
     CHECK_MAKEOPTS=${CHECK_MAKEOPTS:-$DEFAULT_MAKEOPTS}
-    if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
-        rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
-        return 1
+    if in_jenkins; then
+        if ! ctest $CHECK_MAKEOPTS --no-compress-output --output-on-failure -T Test; then
+            # do not return failure, as the jenkins publisher will take care of this
+            rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
+        fi
+    else
+        if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then
+            rm -fr ${TMPDIR:-/tmp}/ceph-asok.*
+            return 1
+        fi
     fi
 }