Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMAN-493 test updates to cnp-jenkins-library #114

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 24 additions & 27 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ properties([
disableConcurrentBuilds()
])

@Library("Infrastructure")
@Library("Infrastructure@HMAN-493_clearHelmRelease_nonServiceApp")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary change should be reversed once hmcts/cnp-jenkins-library#946 is released.


def type = "java"
def product = "ccd"
Expand Down Expand Up @@ -91,14 +91,15 @@ 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.

enableFullFunctionalTest()
enableCleanupOfHelmReleaseOnSuccess()
}
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"
}
Expand Down Expand Up @@ -135,32 +136,28 @@ withPipeline(type, product, component) {
junit '**/test-results/test/*.xml'
}

afterAlways('akschartsinstall') {

// check data-store instance is up
before('fullFunctionalTest:preview') {
// check data-store instance is up
def healthChecker = new HealthChecker(this)
healthChecker.check("$CCD_DATA_STORE_API_BASE_URL/health", 10, 40)

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

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 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
}

afterAlways('fullFunctionalTest: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'
}
}
37 changes: 14 additions & 23 deletions Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ 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"

Expand All @@ -98,28 +97,20 @@ withNightlyPipeline(type, product, component) {
echo "Loading the secrets"
loadVaultSecrets(secrets)

// NB: override IDAM_API_URL late as per `Jenkinsfile_CNP` tests
env.IDAM_API_URL = env.IDAM_API_URL_BASE
}

// 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'
}
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'
}
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ dependencies {
functionalTestImplementation group: 'io.vavr', name: 'vavr', version: '0.10.4'
functionalTestImplementation group: 'io.rest-assured', name: 'rest-assured', version: '4.4.0'

functionalTestImplementation group: 'com.github.hmcts', name: 'befta-fw', version: '8.7.6'
functionalTestImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.19.5'
functionalTestImplementation group: 'com.github.hmcts', name: 'befta-fw', version: '8.7.10'
functionalTestImplementation group: 'com.github.hmcts', name: 'ccd-test-definitions', version: '7.19.11'

}

Expand Down