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/06/24 10:22:42 UTC

[cassandra] branch cassandra-2.2 updated: Improvements and fixes to Jenkinsfile - Fix slack changelog message. currentBuild.changeSets is an array and has to first be formatted. - Remove cassandra-build directory in Summary stage, so 'Restart from Stage' builds work, - Archive the cassandra-test-report.txt artifact - Add StabilityTestDataPublisher to the pipeline junit results (provides flakey info)

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 6df467a  Improvements and fixes to Jenkinsfile  - Fix slack changelog message. currentBuild.changeSets is an array and has to first be formatted.  - Remove cassandra-build directory in Summary stage, so 'Restart from Stage' builds work,  - Archive the cassandra-test-report.txt artifact  - Add StabilityTestDataPublisher to the pipeline junit results (provides flakey info)
6df467a is described below

commit 6df467ad3f0a898b45585a3b8767278cb42e92af
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Fri May 8 19:47:39 2020 +0200

    Improvements and fixes to Jenkinsfile
     - Fix slack changelog message. currentBuild.changeSets is an array and has to first be formatted.
     - Remove cassandra-build directory in Summary stage, so 'Restart from Stage' builds work,
     - Archive the cassandra-test-report.txt artifact
     - Add StabilityTestDataPublisher to the pipeline junit results (provides flakey info)
    
     patch by Mick Semb Wever; reviewed by Berenguer Blasi for CASSANDRA-15875
---
 .jenkins/Jenkinsfile | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile
index 932485cd..77c111c 100644
--- a/.jenkins/Jenkinsfile
+++ b/.jenkins/Jenkinsfile
@@ -253,14 +253,19 @@ pipeline {
         }
     stage('Summary') {
       steps {
+          sh "rm -fR cassandra-builds"
           sh "git clone https://gitbox.apache.org/repos/asf/cassandra-builds.git"
           sh "./cassandra-builds/build-scripts/cassandra-test-report.sh"
-          junit '**/build/test/**/TEST*.xml,**/cqlshlib.xml,**/nosetests.xml'
+          junit testResults: '**/build/test/**/TEST*.xml,**/cqlshlib.xml,**/nosetests.xml', testDataPublishers: [[$class: 'StabilityTestDataPublisher']]
 
           // the following should fail on any installation other than builds.apache.org
           //  TODO: keep jenkins infrastructure related settings in `cassandra_job_dsl_seed.groovy`
           warnError('cannot send notifications') {
-              slackSend channel: '#cassandra-builds', message: ":apache: <${env.BUILD_URL}|${currentBuild.fullDisplayName}> completed: ${currentBuild.result}. ${env.GIT_COMMIT}\n${currentBuild.changeSets}"
+              script {
+                changes = formatChanges(currentBuild.changeSets)
+                echo "changes: ${changes}"
+              }
+              slackSend channel: '#cassandra-builds', message: ":apache: <${env.BUILD_URL}|${currentBuild.fullDisplayName}> completed: ${currentBuild.result}. ${env.GIT_COMMIT}\n${changes}"
               emailext to: 'builds@cassandra.apache.org', subject: "Build complete: ${currentBuild.fullDisplayName} [${currentBuild.result}] ${env.GIT_COMMIT}", body: '''
 -------------------------------------------------------------------------------
 Build ${ENV,var="JOB_NAME"} #${BUILD_NUMBER} ${BUILD_STATUS}
@@ -276,6 +281,11 @@ ${FILE,path="cassandra-test-report.txt"}
 '''
           }
       }
+      post {
+          always {
+              archiveArtifacts artifacts: 'cassandra-test-report.txt', fingerprint: true
+          }
+      }
     }
   }
 }
@@ -288,3 +298,15 @@ def copyTestResults(target) {
             selector: [$class: 'StatusBuildSelector', stable: false],
             target: target]);
 }
+
+def formatChanges(changeLogSets) {
+    def result = ''
+    for (int i = 0; i < changeLogSets.size(); i++) {
+        def entries = changeLogSets[i].items
+        for (int j = 0; j < entries.length; j++) {
+            def entry = entries[j]
+            result = result + "${entry.commitId} by ${entry.author} on ${new Date(entry.timestamp)}: ${entry.msg}\n"
+        }
+    }
+    return result
+}


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