github.com/pingcap/ticdc@v0.0.0-20220526033649-485a10ef2652/scripts/jenkins_ci/cdc_ghpr_test.groovy (about) 1 catchError { 2 3 stage("Unit Test") { 4 node("${GO_TEST_SLAVE}") { 5 container("golang") { 6 def ws = pwd() 7 deleteDir() 8 unstash 'ticdc' 9 10 dir("go/src/github.com/pingcap/ticdc") { 11 sh """ 12 GO111MODULE=off GOPATH=\$GOPATH:${ws}/go PATH=\$GOPATH/bin:${ws}/go/bin:\$PATH make test 13 """ 14 } 15 } 16 } 17 } 18 19 currentBuild.result = "SUCCESS" 20 } 21 22 stage('Summary') { 23 def duration = ((System.currentTimeMillis() - currentBuild.startTimeInMillis) / 1000 / 60).setScale(2, BigDecimal.ROUND_HALF_UP) 24 def slackmsg = "[#${ghprbPullId}: ${ghprbPullTitle}]" + "\n" + 25 "${ghprbPullLink}" + "\n" + 26 "${ghprbPullDescription}" + "\n" + 27 "Unit Test Result: `${currentBuild.result}`" + "\n" + 28 "Elapsed Time: `${duration} mins` " + "\n" + 29 "${env.RUN_DISPLAY_URL}" 30 31 if (currentBuild.result != "SUCCESS") { 32 slackSend channel: '#jenkins-ci', color: 'danger', teamDomain: 'pingcap', tokenCredentialId: 'slack-pingcap-token', message: "${slackmsg}" 33 } 34 }