From edd1205db1b2fcbbcfae13ba4a55fd49b1474378 Mon Sep 17 00:00:00 2001 From: Ramzi El-Yafi Date: Fri, 20 Dec 2019 14:44:45 +0000 Subject: [PATCH] OS 4.3 -> OS 4.4 Merge (#5819) * Prevent on-demand tests re-triggering from branch indexing * Mark integration test tasks with "big" node taint * Jenkins file for nightly regression tests (#5786) * Jenkins file for nightly regression tests * Use k8s instead of gke cluster * DOCS: Update UAT.md (#5602) * Fix report generation against regression builds (#5818) * Prevent on-demand tests re-triggering from branch indexing * Mark integration test tasks with "big" node taint * Jenkins file for nightly regression tests (#5786) * Jenkins file for nightly regression tests * Use k8s instead of gke cluster Co-authored-by: Stefano Franz Co-authored-by: carolynequinn <44175553+carolynequinn@users.noreply.github.com> --- .ci/dev/nightly-regression/Jenkinsfile | 65 ++++++++++++++++++++++++++ .ci/dev/regression/Jenkinsfile | 41 +++++++++++++++- .ci/dev/smoke/Jenkinsfile | 5 +- build.gradle | 4 ++ docs/source/corda-network/UAT.md | 18 +++---- 5 files changed, 121 insertions(+), 12 deletions(-) create mode 100644 .ci/dev/nightly-regression/Jenkinsfile diff --git a/.ci/dev/nightly-regression/Jenkinsfile b/.ci/dev/nightly-regression/Jenkinsfile new file mode 100644 index 0000000000..44ea33875b --- /dev/null +++ b/.ci/dev/nightly-regression/Jenkinsfile @@ -0,0 +1,65 @@ +@Library('existing-build-control') +import static com.r3.build.BuildControl.killAllExistingBuildsForJob + +killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) + +pipeline { + agent { label 'k8s' } + options { + timestamps() + overrideIndexTriggers(false) + buildDiscarder(logRotator(daysToKeepStr: '7', artifactDaysToKeepStr: '7')) + } + triggers { + pollSCM ignorePostCommitHooks: true, scmpoll_spec: '@midnight' + } + + environment { + DOCKER_TAG_TO_USE = "${env.GIT_COMMIT.subSequence(0, 8)}" + EXECUTOR_NUMBER = "${env.EXECUTOR_NUMBER}" + BUILD_ID = "${env.BUILD_ID}-${env.JOB_NAME}" + ARTIFACTORY_CREDENTIALS = credentials('artifactory-credentials') + } + + stages { + stage('Generate Build Image') { + steps { + withCredentials([string(credentialsId: 'container_reg_passwd', variable: 'DOCKER_PUSH_PWD')]) { + sh "./gradlew " + + "-Dkubenetize=true " + + "-Ddocker.push.password=\"\${DOCKER_PUSH_PWD}\" " + + "-Ddocker.work.dir=\"/tmp/\${EXECUTOR_NUMBER}\" " + + "-Ddocker.build.tag=\"\${DOCKER_TAG_TO_USE}\"" + + " clean pushBuildImage --stacktrace" + } + sh "kubectl auth can-i get pods" + } + } + + stage('Regression Test') { + steps { + sh "./gradlew " + + "-DbuildId=\"\${BUILD_ID}\" " + + "-Dkubenetize=true " + + "-Ddocker.run.tag=\"\${DOCKER_TAG_TO_USE}\" " + + "-Dartifactory.username=\"\${ARTIFACTORY_CREDENTIALS_USR}\" " + + "-Dartifactory.password=\"\${ARTIFACTORY_CREDENTIALS_PSW}\" " + + "-Dgit.branch=\"\${GIT_BRANCH}\" " + + "-Dgit.target.branch=\"\${GIT_BRANCH}\" " + + " parallelRegressionTest --stacktrace" + } + } + } + + + post { + always { + archiveArtifacts artifacts: '**/pod-logs/**/*.log', fingerprint: false + junit testResults: '**/build/test-results-xml/**/*.xml', allowEmptyResults: true + } + cleanup { + deleteDir() /* clean up our workspace */ + } + } +} + diff --git a/.ci/dev/regression/Jenkinsfile b/.ci/dev/regression/Jenkinsfile index 9447598306..99aa0d1a64 100644 --- a/.ci/dev/regression/Jenkinsfile +++ b/.ci/dev/regression/Jenkinsfile @@ -52,7 +52,46 @@ 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 { + try { + /* + * Copy all JUnit results files into a single top level directory. + * This is necessary to stop the allure plugin from hitting out + * of memory errors due to being passed many directories with + * long paths. + * + * File names are pre-pended with the pod number when + * 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" + ''' + allure includeProperties: false, + jdk: '', + results: [[path: '**/allure-input']] + } catch (err) { + echo("Allure report generation failed: $err") + + if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { + currentBuild.result = 'UNSTABLE' + } + } + } } cleanup { deleteDir() /* clean up our workspace */ diff --git a/.ci/dev/smoke/Jenkinsfile b/.ci/dev/smoke/Jenkinsfile index d5332b2508..16ae19b53d 100644 --- a/.ci/dev/smoke/Jenkinsfile +++ b/.ci/dev/smoke/Jenkinsfile @@ -5,7 +5,8 @@ killAllExistingBuildsForJob(env.JOB_NAME, env.BUILD_NUMBER.toInteger()) pipeline { agent { label 'k8s' } - options { timestamps() } + options { timestamps() + overrideIndexTriggers(false) } triggers { issueCommentTrigger('.*smoke tests.*') @@ -94,4 +95,4 @@ def currentBuildTriggeredByComment() { } return triggerCause != null -} \ No newline at end of file +} diff --git a/build.gradle b/build.gradle index f1fd26eb20..6f2f36ce88 100644 --- a/build.gradle +++ b/build.gradle @@ -637,6 +637,7 @@ task allParallelIntegrationTest(type: ParallelTestGroup) { coresPerFork 5 memoryInGbPerFork 12 distribute DistributeTestsBy.METHOD + nodeTaints "big" } task allParallelUnitTest(type: ParallelTestGroup) { podLogLevel PodLogLevel.INFO @@ -655,6 +656,7 @@ task allParallelUnitAndIntegrationTest(type: ParallelTestGroup) { coresPerFork 6 memoryInGbPerFork 10 distribute DistributeTestsBy.METHOD + nodeTaints "big" } task parallelRegressionTest(type: ParallelTestGroup) { testGroups "test", "integrationTest", "slowIntegrationTest", "smokeTest" @@ -663,6 +665,7 @@ task parallelRegressionTest(type: ParallelTestGroup) { coresPerFork 6 memoryInGbPerFork 10 distribute DistributeTestsBy.METHOD + nodeTaints "big" } task allParallelSmokeTest(type: ParallelTestGroup) { testGroups "slowIntegrationTest", "smokeTest" @@ -671,6 +674,7 @@ task allParallelSmokeTest(type: ParallelTestGroup) { coresPerFork 6 memoryInGbPerFork 10 distribute DistributeTestsBy.CLASS + nodeTaints "big" } apply plugin: 'com.r3.testing.distributed-testing' apply plugin: 'com.r3.testing.image-building' diff --git a/docs/source/corda-network/UAT.md b/docs/source/corda-network/UAT.md index f2f5ca7f13..742e55adba 100644 --- a/docs/source/corda-network/UAT.md +++ b/docs/source/corda-network/UAT.md @@ -1,9 +1,9 @@ -Corda Network: UAT Environment +Corda Network: Pre-Production Environment ============================= -Corda Network UAT seeks to provide a test environment which is as close as possible to Corda Network in its make-up and operation. +Corda Network Pre-Production (or UAT) seeks to provide a test environment which is as close as possible to Corda Network in its make-up and operation. -For owners of tested CorDapps with a firm plan to take them into production, a bespoke UAT environment can be provided by R3. Here, such CorDapps can be further tested in the network configuration they will experience in production, utilising relevant Corda Network Services (including the Identity Operator, and trusted notaries). +For owners of tested CorDapps with a firm plan to take them into production, a bespoke Pre-Production environment is provided. Here, such CorDapps can be further tested in the network configuration they will experience in production, utilising relevant Corda Network Services (including the Identity Operator, Network Map and notaries). Corda UAT is not intended for customers' full test cycles, as it is expected that the bulk of CorDapp testing will occur in simpler network configurations run by the CorDapp provider, but is available for testing of functionally complete and tested CorDapps in realistic network settings to simulate the real-world business environment, including the production settings of network parameters, Corda network services and supported Corda versions. @@ -12,10 +12,10 @@ UAT is therefore more aligned to the testing of the operational characteristics More information about UAT will continue to be uploaded on this site or related sub-sites. -Joining the UAT environment +Joining the Pre-Production environment --------------------------- -*The below joining steps assume the potential participant is joining the UAT environment directly, and as such is not “sponsoring” or onboarding other participants. If this is the case, please contact your Corda representative for how to ‘sponsor’ end-participants onto UAT.* +*The below joining steps assume the potential participant is joining the Pre-Production environment directly, and as such is not “sponsoring” or onboarding other participants. If this is the case, please contact your Corda representative for how to ‘sponsor’ end-participants on.* **Pre-requisites:** @@ -29,12 +29,12 @@ Joining the UAT environment * Access to the appropriate environment has been agreed with your project representative with sufficient advance notice (4 weeks standard but may be longer if you have special service requirements) to ensure appropriate SLAs can be in place. Your project representative will be able to supply the booking template. **Note**: -Corda Network UAT is governed by an [independent Foundation](https://corda.network/governance/index.html). +Corda Network Pre-Production is governed by an [independent Foundation](https://corda.network/governance/index.html). -Steps to join UAT environment ------------------------------ +Steps to join the Pre-Production environment +------------------------------------------- Steps to join are outlined on the [Corda Network site](https://corda.network/participation/index.html). -For further questions on this process, please contact us - preferably on the mailing list: https://groups.io/g/corda-network +For further questions on this process, please contact us - preferably on the mailing list: https://groups.io/g/corda-network or at info@corda.network