Skip to content

Commit

Permalink
TM-137 Daily email report for release branch regression tests (corda#…
Browse files Browse the repository at this point in the history
…5797)

* Daily email report for release branch regression tests

* Manual merge fix
  • Loading branch information
relyafi committed Jan 24, 2020
1 parent 9ae60a9 commit 2809c04
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .ci/dev/regression/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@ pipeline {
always {
archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false
junit '**/build/test-results-xml/**/*.xml'
allure includeProperties: false, jdk: '', results: [[path: '**/build/test-results-xml/**']]

script
{
// We want to send a summary email, but want to limit to once per day.
// Comparing the dates of the previous and current builds achieves this,
// i.e. we will only send an email for the first build on a given day.
def prevBuildDate = new Date(
currentBuild?.previousBuild.timeInMillis ?: 0).clearTime()
def currentBuildDate = new Date(
currentBuild.timeInMillis).clearTime()

if (prevBuildDate != currentBuildDate) {
def statusSymbol = '\u2753'
switch(currentBuild.result) {
case 'SUCCESS':
statusSymbol = '\u2705'
break;
case 'UNSTABLE':
case 'FAILURE':
statusSymbol = '\u274c'
break;
default:
break;
}

echo('First build for this date, sending summary email')
emailext to: '$DEFAULT_RECIPIENTS',
subject: "$statusSymbol" + '$BRANCH_NAME regression tests - $BUILD_STATUS',
mimeType: 'text/html',
body: '${SCRIPT, template="groovy-html.template"}'
} else {
echo('Already sent summary email today, suppressing')

script {
try {
Expand Down

0 comments on commit 2809c04

Please sign in to comment.