diff --git a/Jenkinsfile_CNP b/Jenkinsfile_CNP index ad690bf0..4a2f960d 100644 --- a/Jenkinsfile_CNP +++ b/Jenkinsfile_CNP @@ -2,7 +2,6 @@ import uk.gov.hmcts.contino.AppPipelineDsl import uk.gov.hmcts.contino.GithubAPI import uk.gov.hmcts.contino.GradleBuilder -import uk.gov.hmcts.contino.HealthChecker properties([ [ @@ -16,7 +15,7 @@ properties([ disableConcurrentBuilds() ]) -@Library("Infrastructure") +@Library("Infrastructure@HMAN-514_functionalTest_nonServiceApp") def type = "java" def product = "ccd" @@ -91,8 +90,8 @@ withPipeline(type, product, component) { } onPR { enableSlackNotifications('#ccd-pr-builds') + env.ENV='preview' - env.TEST_URL="https://ccd-data-store-api-ccd-next-hearing-date-updater-pr-${CHANGE_ID}.service.core-compute-preview.internal" // This is really not needed but here as a hack around TLS url env.CCD_DATA_STORE_API_BASE_URL = "https://ccd-data-store-api-ccd-next-hearing-date-updater-pr-${CHANGE_ID}.service.core-compute-preview.internal" env.DEFINITION_STORE_URL_BASE = "https://ccd-definition-store-ccd-next-hearing-date-updater-pr-${CHANGE_ID}.service.core-compute-preview.internal" env.TEST_STUB_SERVICE_BASE_URL = "http://ccd-next-hearing-date-updater-pr-${CHANGE_ID}-ccd-test-stubs-service" // NB : when def file is imported this will lead to data-store.preview -> test-stub.preview. @@ -104,7 +103,6 @@ withPipeline(type, product, component) { } onNonPR { env.ENV='aat' - env.TEST_URL="http://ccd-data-store-api-aat.service.core-compute-aat.internal" env.CCD_DATA_STORE_API_BASE_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal" env.DEFINITION_STORE_URL_BASE = "http://ccd-definition-store-api-aat.service.core-compute-aat.internal" } @@ -115,6 +113,8 @@ withPipeline(type, product, component) { nonServiceApp() syncBranchesWithMaster(branchesToSync) + enableFullFunctionalTestNonServiceApp(env.CCD_DATA_STORE_API_BASE_URL) + afterAlways('test') { // hmcts/cnp-jenkins-library may fail to copy artifacts after checkstyle error so repeat command (see /src/uk/gov/hmcts/contino/GradleBuilder.groovy) steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/checkstyle/*.html' @@ -141,32 +141,43 @@ withPipeline(type, product, component) { junit '**/test-results/test/*.xml' } - afterAlways('akschartsinstall') { - - // check data-store instance is up - def healthChecker = new HealthChecker(this) - healthChecker.check("$CCD_DATA_STORE_API_BASE_URL/health", 10, 40) + before('functionalTest:preview') { + // NB: override IDAM_API_URL late so its value does not corrupt config used in integration tests + env.IDAM_API_URL = env.IDAM_API_URL_BASE - try { - // NB: override IDAM_API_URL late so its value does not corrupt config used in integration tests - env.IDAM_API_URL = env.IDAM_API_URL_BASE + // suppress SSL warnings as we are crossing boundary jenkins -> preview `feign.httpclient.disable-ssl-validation: true` + env.FEIGN_HTTPCLIENT_DISABLE_SSL_VALIDATION = true + } - // suppress SSL warnings as we are crossing boundary jenkins -> preview `feign.httpclient.disable-ssl-validation: true` - env.FEIGN_HTTPCLIENT_DISABLE_SSL_VALIDATION = true + before('functionalTest:aat') { + // NB: override IDAM_API_URL late so its value does not corrupt config used in integration tests + env.IDAM_API_URL = env.IDAM_API_URL_BASE + } - builder.functionalTest() - } finally { + afterAlways('functionalTest:preview') { + publishHTML target: [ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports/tests/functional", + reportFiles : "overview-features.html,overview-failures.html,", + reportTitles : "Features,Failures", + reportName : "Next Hearing Date Updater Functional Test Report" + ] + junit '**/test-results/functional/*.xml' + } - publishHTML target: [ - allowMissing : true, - alwaysLinkToLastBuild: true, - keepAll : true, - reportDir : "build/reports/tests/functional", - reportFiles : "overview-features.html,overview-failures.html,", - reportTitles : "Features,Failures", - reportName : "Next Hearing Date Updater Functional Test Report" - ] - junit '**/test-results/functional/*.xml' - } + afterAlways('functionalTest:aat') { + publishHTML target: [ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports/tests/functional", + reportFiles : "overview-features.html,overview-failures.html,", + reportTitles : "Features,Failures", + reportName : "Next Hearing Date Updater Functional Test Report" + ] + junit '**/test-results/functional/*.xml' } + } diff --git a/Jenkinsfile_nightly b/Jenkinsfile_nightly index f0578e23..d08acf94 100644 --- a/Jenkinsfile_nightly +++ b/Jenkinsfile_nightly @@ -78,48 +78,33 @@ withNightlyPipeline(type, product, component) { // apply standard `onNonPR` env variables for nightly env.ENV='aat' - env.TEST_URL="http://ccd-data-store-api-aat.service.core-compute-aat.internal" env.CCD_DATA_STORE_API_BASE_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal" env.DEFINITION_STORE_URL_BASE = "http://ccd-definition-store-api-aat.service.core-compute-aat.internal" - enableAksStagingDeployment() disableLegacyDeployment() loadVaultSecrets(secrets) nonServiceApp() enableMutationTest() - enableFullFunctionalTest() - afterAlways('fortify-scan') { - steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*' - } + enableFullFunctionalTestNonServiceApp(env.CCD_DATA_STORE_API_BASE_URL) before('fullFunctionalTest') { - echo "Loading the secrets" - loadVaultSecrets(secrets) - - - // Execute functional tests - echo "Just waiting a while to ensure that the pod has run the job" - sh "sleep 30s" - echo "Verifying that functional test run correctly" - try { - // NB: override IDAM_API_URL late as per `Jenkinsfile_CNP` tests - env.IDAM_API_URL = env.IDAM_API_URL_BASE - - builder.functionalTest() - } finally { - - publishHTML target: [ - allowMissing : true, - alwaysLinkToLastBuild: true, - keepAll : true, - reportDir : "build/reports/tests/functional", - reportFiles : "overview-features.html,overview-failures.html,", - reportTitles : "Features,Failures", - reportName : "Next Hearing Date Updater Functional Test Report" - ] - junit '**/test-results/functional/*.xml' - } + // NB: override IDAM_API_URL late as per `Jenkinsfile_CNP` tests + env.IDAM_API_URL = env.IDAM_API_URL_BASE + } + + afterAlways('fullFunctionalTest') { + publishHTML target: [ + allowMissing : true, + alwaysLinkToLastBuild: true, + keepAll : true, + reportDir : "build/reports/tests/functional", + reportFiles : "overview-features.html,overview-failures.html,", + reportTitles : "Features,Failures", + reportName : "Next Hearing Date Updater Functional Test Report" + ] + junit '**/test-results/functional/*.xml' } + } diff --git a/charts/ccd-next-hearing-date-updater/Chart.yaml b/charts/ccd-next-hearing-date-updater/Chart.yaml index 481c7e1a..5e97d221 100644 --- a/charts/ccd-next-hearing-date-updater/Chart.yaml +++ b/charts/ccd-next-hearing-date-updater/Chart.yaml @@ -8,7 +8,7 @@ maintainers: - name: HMCTS CCD Team dependencies: - name: job - version: ~0.7.9 + version: ~0.7.10 repository: 'https://hmctspublic.azurecr.io/helm/v1/repo/' - name: elasticsearch version: 7.8.2