You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2020/09/30 20:42:07 UTC

[cassandra] branch cassandra-2.2 updated: In Jenkins propagate FAILURE from stages to pipeline, ssh artefacts to nightlies, and move ant's junitreport generation to a separate target "generate-test-report"

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

mck pushed a commit to branch cassandra-2.2
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-2.2 by this push:
     new aaef142  In Jenkins propagate FAILURE from stages to pipeline, ssh artefacts to nightlies, and move ant's junitreport generation to a separate target "generate-test-report"
aaef142 is described below

commit aaef142f48c2bff43eb358f3901e5959ce8e6ebf
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Fri Aug 28 08:47:06 2020 +0200

    In Jenkins propagate FAILURE from stages to pipeline, ssh artefacts to nightlies, and move ant's junitreport generation to a separate target "generate-test-report"
    
     patch by Mick Semb Wever; reviewed by Berenguer Blasi for CASSANDRA-16128
---
 .jenkins/Jenkinsfile | 15 ++++++++++++++-
 build.xml            | 21 +++++++++------------
 2 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile
index dc5982a..09930ee 100644
--- a/.jenkins/Jenkinsfile
+++ b/.jenkins/Jenkinsfile
@@ -43,6 +43,7 @@ pipeline {
               script {
                 jvm_dtest = build job: "${env.JOB_NAME}-jvm-dtest", propagate: false
                 if (jvm_dtest.result != 'SUCCESS') unstable('jvm-dtest failures')
+                if (jvm_dtest.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -60,6 +61,7 @@ pipeline {
               script {
                 test = build job: "${env.JOB_NAME}-test", propagate: false
                 if (test.result != 'SUCCESS') unstable('unit test failures')
+                if (test.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -77,6 +79,7 @@ pipeline {
               script {
                 long_test = build job: "${env.JOB_NAME}-long-test", propagate: false
                 if (long_test.result != 'SUCCESS') unstable('long unit test failures')
+                if (long_test.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -94,6 +97,7 @@ pipeline {
               script {
                 burn = build job: "${env.JOB_NAME}-test-burn", propagate: false
                 if (burn.result != 'SUCCESS') unstable('burn test failures')
+                if (burn.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -111,6 +115,7 @@ pipeline {
               script {
                 compression = build job: "${env.JOB_NAME}-test-compression", propagate: false
                 if (compression.result != 'SUCCESS') unstable('compression failures')
+                if (compression.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -132,6 +137,7 @@ pipeline {
               script {
                 dtest = build job: "${env.JOB_NAME}-dtest", propagate: false
                 if (dtest.result != 'SUCCESS') unstable('dtest failures')
+                if (dtest.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -149,6 +155,7 @@ pipeline {
               script {
                 dtest_large = build job: "${env.JOB_NAME}-dtest-large", propagate: false
                 if (dtest_large.result != 'SUCCESS') unstable('dtest-large failures')
+                if (dtest_large.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -166,6 +173,7 @@ pipeline {
               script {
                 dtest_novnode = build job: "${env.JOB_NAME}-dtest-novnode", propagate: false
                 if (dtest_novnode.result != 'SUCCESS') unstable('dtest-novnode failures')
+                if (dtest_novnode.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -183,6 +191,7 @@ pipeline {
               script {
                 dtest_offheap = build job: "${env.JOB_NAME}-dtest-offheap", propagate: false
                 if (dtest_offheap.result != 'SUCCESS') unstable('dtest-offheap failures')
+                if (dtest_offheap.result == 'FAILURE') currentBuild.result='FAILURE'
               }
             }
             post {
@@ -226,10 +235,14 @@ ${FAILED_TESTS,maxTests=500,showMessage=false,showStack=false}
 ${FILE,path="cassandra-test-report.txt"}
 '''
           }
+          sh "echo \"cassandra-builds at: `git -C cassandra-builds log -1 --pretty=format:'%h %an %ad %s'`\" > builds.head"
+          sh "find . -type f -name \\*.head -exec cat {} \\;"
+          sh "xz cassandra-test-report.txt TESTS-TestSuites.xml"
       }
       post {
           always {
-              archiveArtifacts artifacts: 'cassandra-test-report.txt', fingerprint: true
+              archiveArtifacts artifacts: 'cassandra-test-report.txt.xz', fingerprint: true
+              sshPublisher(publishers: [sshPublisherDesc(configName: 'Nightlies', transfers: [sshTransfer(remoteDirectory: 'cassandra/${JOB_NAME}/${BUILD_NUMBER}/', sourceFiles: 'cassandra-test-report.txt.xz, TESTS-TestSuites.xml.xz')])])
           }
       }
     }
diff --git a/build.xml b/build.xml
index 5f404fe..693cc8f 100644
--- a/build.xml
+++ b/build.xml
@@ -1726,12 +1726,6 @@
                        testtag="@{testtag}" showoutput="false" >
           <optjvmargs/>
       </testmacrohelper>
-      <junitreport todir="${build.test.dir}">
-        <fileset dir="${build.test.dir}/output">
-          <include name="**/TEST-*.xml"/>
-        </fileset>
-        <report format="frames" todir="${build.test.dir}/junitreport"/>
-      </junitreport>
       <fail message="Some test(s) failed.">
         <condition>
             <and>
@@ -1750,12 +1744,6 @@
     <attribute name="testdelegate"/>
     <sequential>
       <testparallelhelper testdelegate="@{testdelegate}"/>
-      <junitreport todir="${build.test.dir}">
-        <fileset dir="${build.test.dir}/output">
-          <include name="**/TEST-*.xml"/>
-        </fileset>
-        <report format="frames" todir="${build.test.dir}/junitreport"/>
-      </junitreport>
       <fail message="Some test(s) failed.">
         <condition>
             <and>
@@ -1810,6 +1798,15 @@
     <testparallel testdelegate="testlist"/>
   </target>
 
+  <target name="generate-test-report" description="Generates JUnit's HTML report from results already in build/output">
+      <junitreport todir="${build.test.dir}">
+        <fileset dir="${build.test.dir}/output">
+          <include name="**/TEST-*.xml"/>
+        </fileset>
+        <report format="frames" todir="${build.test.dir}/junitreport"/>
+      </junitreport>
+  </target>
+
   <!-- run a list of tests as provided in -Dtest.classlistfile (or default of 'testnames.txt')
   The class list file should be one test class per line, with the path starting after test/unit
   e.g. org/apache/cassandra/hints/HintMessageTest.java -->


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org