Skip to content

Commit

Permalink
Merge pull request corda#5889 from corda/ramzi/43-44-merge
Browse files Browse the repository at this point in the history
OS 4.3 -> OS 4.4 Merge
  • Loading branch information
roastario authored Jan 27, 2020
2 parents 7f62046 + ac8a4fc commit fa55b66
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .ci/dev/integration/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down
2 changes: 1 addition & 1 deletion .ci/dev/nightly-regression/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down
6 changes: 6 additions & 0 deletions .ci/dev/on-demand-tests/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@Library('corda-shared-build-pipeline-steps') _
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())

onDemandTestPipeline('k8s', '.ci/dev/on-demand-tests/commentMappings.yml')
4 changes: 4 additions & 0 deletions .ci/dev/on-demand-tests/commentMappings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
integration: { allParallelIntegrationTest }
pr-merge: { parallelRegressionTest }
smoke: { allParallelSmokeTest }
unit: { allParallelUnitTest }
59 changes: 42 additions & 17 deletions .ci/dev/regression/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down Expand Up @@ -65,22 +65,13 @@ pipeline {
* copied to avoid collisions between files where the same test
* classes have run on multiple pods.
*/
sh label: 'Compact test results',
script:
'''#!/bin/bash
shopt -s globstar
rm -rf allure-input
mkdir allure-input
for i in **/test-results-xml/**/test-runs/test-reports/**
do
[ -f $i ] &&
cp $i allure-input/$(echo $i | sed -e \\
\'s/.*test-results-xml\\/.*-\\(.*\\)\\/test-runs\\/.*\\/\\(.*\\)$/\\1\\-\\2/\')
done
echo "Finished compacting JUnit results"
'''
fileOperations([fileCopyOperation(
includes: '**/test-results-xml/**/test-runs/test-reports/**',
targetLocation: 'allure-input',
flattenFiles: true,
renameFiles: true,
sourceCaptureExpression: '.*test-results-xml/.*-([\\d]+)/.*/([^/]+)$',
targetNameExpression: '$1-$2')])
allure includeProperties: false,
jdk: '',
results: [[path: '**/allure-input']]
Expand All @@ -92,6 +83,40 @@ pipeline {
}
}
}

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')
}
}
}
cleanup {
deleteDir() /* clean up our workspace */
Expand Down
2 changes: 1 addition & 1 deletion .ci/dev/smoke/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down
2 changes: 1 addition & 1 deletion .ci/dev/unit/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import static com.r3.build.BuildControl.killAllExistingBuildsForJob
@Library('existing-build-control')
@Library('corda-shared-build-pipeline-steps')
import static com.r3.build.BuildControl.killAllExistingBuildsForJob

killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger())
Expand Down Expand Up @@ -71,4 +71,4 @@ pipeline {
deleteDir() /* clean up our workspace */
}
}
}
}
2 changes: 1 addition & 1 deletion detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ style:
ignoreNamedArgument: true
ignoreEnums: true
MaxLineLength:
active: true
active: false
excludes: "**/buildSrc/**"
maxLineLength: 140
excludePackageStatements: true
Expand Down

0 comments on commit fa55b66

Please sign in to comment.