-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_nightly
138 lines (123 loc) · 6.63 KB
/
Jenkinsfile_nightly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!groovy
properties([
pipelineTriggers([cron('H 07 * * 1-5')]),
parameters([
string(name: 'UI_URL_TO_TEST', defaultValue: 'https://manage-case.aat.platform.hmcts.net/', description: 'The URL you want to run these tests against'),
string(name: 'API_URL_TO_TEST', defaultValue: 'http://sscs-tribunals-api-aat.service.core-compute-aat.internal', description: 'The URL you want to run these tests against'),
string(name: 'SecurityRules',
defaultValue: 'https://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'The URL you want to run these tests against'),
])
])
@Library("Infrastructure")
def type = "java"
def product = "sscs"
def component = "tribunals-api"
def secrets = [
'sscs-${env}' : [
secret('idam-api', 'IDAM_API_URL'),
secret('idam-oauth-user', 'IDAM_OAUTH2_CLIENT_ID'),
secret('ccd-api', 'CORE_CASE_DATA_API_URL'),
secret('idam-redirect', 'IDAM_OAUTH2_REDIRECT_URL'),
secret('idam-sscs-systemupdate-user', 'IDAM_SSCS_SYSTEMUPDATE_USER'),
secret('idam-sscs-systemupdate-password', 'IDAM_SSCS_SYSTEMUPDATE_PASSWORD'),
secret('idam-sscs-oauth2-client-secret', 'IDAM_OAUTH2_CLIENT_SECRET'),
secret('idam-s2s-api', 'IDAM_S2S_AUTH'),
secret('sscs-s2s-secret', 'IDAM_S2S_AUTH_TOTP_SECRET'),
secret('s2s-micro', 'IDAM_S2S_AUTH_MICROSERVICE'),
secret('docmosis-endpoint', 'PDF_SERVICE_CONVERT_URL'),
secret('docmosis-api-key', 'PDF_SERVICE_ACCESS_KEY'),
// tya notifications
secret('notification-key', 'NOTIFICATION_API_KEY'),
secret('notification-test-key', 'NOTIFICATION_API_TEST_KEY'),
secret('sscs-email-mac-secret-text', 'EMAIL_MAC_SECRET_TEXT'),
secret('tya-link', 'SSCS_TRACK_YOUR_APPEAL_LINK'),
secret('evidence-share-topic-shared-access-key', 'AMQP_PASSWORD'),
//e2e tests
secret('test-e2e-caseofficer-username', 'TEST_CASEOFFICER_USERNAME'),
secret('test-e2e-caseofficer-password', 'TEST_CASEOFFICER_PASSWORD'),
secret('test-e2e-hmc-caseofficer-username', 'TEST_HMC_CASEOFFICER_USERNAME'),
secret('test-e2e-hmc-caseofficer-password', 'TEST_HMC_CASEOFFICER_PASSWORD'),
secret('test-e2e-judge-username', 'TEST_JUDGE_USERNAME'),
secret('test-e2e-judge-password', 'TEST_JUDGE_PASSWORD'),
secret('test-e2e-salaried-judge-username', 'TEST_SALARIED_JUDGE_USERNAME'),
secret('test-e2e-salaried-judge-password', 'TEST_SALARIED_JUDGE_PASSWORD'),
secret('test-e2e-fee-paid-judge-username', 'TEST_FEE_PAID_JUDGE_USERNAME'),
secret('test-e2e-fee-paid-judge-password', 'TEST_FEE_PAID_JUDGE_PASSWORD'),
secret('test-e2e-dwp-username', 'TEST_DWP_USERNAME'),
secret('test-e2e-dwp-password', 'TEST_DWP_PASSWORD'),
secret('test-e2e-am-tcw-username', 'TEST_AM_TRIBUNAL_CASEWORKER_USERNAME'),
secret('test-e2e-am-tcw-password', 'TEST_AM_TRIBUNAL_CASEWORKER_PASSWORD'),
secret('test-e2e-am-caseofficer-case-allocator-username', 'TEST_AM_CASEOFFICER_CASE_ALLOCATOR_USERNAME'),
secret('test-e2e-am-caseofficer-case-allocator-password', 'TEST_AM_CASEOFFICER_CASE_ALLOCATOR_PASSWORD'),
secret('test-e2e-hmrc-username', 'TEST_HMRC_USERNAME'),
secret('test-e2e-hmrc-password', 'TEST_HMRC_PASSWORD'),
secret('test-e2e-am-regional-center-admin-username', 'TEST_AM_REGIONAL_CENTER_ADMIN_USERNAME'),
secret('test-e2e-am-regional-center-admin-password', 'TEST_AM_REGIONAL_CENTER_ADMIN_PASSWORD'),
secret('test-e2e-am-regional-center-team-leader-username', 'TEST_AM_REGIONAL_CENTER_TEAM_LEADER_USERNAME'),
secret('test-e2e-am-regional-center-team-leader-password', 'TEST_AM_REGIONAL_CENTER_TEAM_LEADER_PASSWORD'),
secret('test-e2e-am-caseofficer-username', 'TEST_AM_CASEOFFICER_USERNAME'),
secret('test-e2e-am-caseofficer-password', 'TEST_AM_CASEOFFICER_PASSWORD'),
secret('test-e2e-caseofficer-username', 'TEST_AM_SUPERUSER_USERNAME'),
secret('test-e2e-caseofficer-password', 'TEST_AM_SUPERUSER_PASSWORD'),
secret('test-e2e-superuser-username', 'SUPER_USER_USERNAME'),
secret('test-e2e-superuser-password', 'SUPER_USER_PASSWORD'),
secret('test-e2e-am-senior-tcw-case-allocator-username', 'TEST_AM_SENIOR_TRIBUNAL_CASEWORKER_CASE_ALLOCATOR_USERNAME'),
secret('test-e2e-am-senior-tcw-case-allocator-password', 'TEST_AM_SENIOR_TRIBUNAL_CASEWORKER_CASE_ALLOCATOR_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def setAatEnvVars() {
env.PREVIEW_BRANCH_WITH_LOCAL_CCD = false;
env.TEST_E2E_URL_WEB = "https://manage-case.aat.platform.hmcts.net/"
env.TEST_E2E_API_URI = "http://sscs-tribunals-api-aat.service.core-compute-aat.internal"
env.CCD_API_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal"
env.CORE_CASE_DATA_API_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal"
env.CCD_GW_API = "https://gateway-ccd.aat.platform.hmcts.net"
env.CASE_DOCUMENT_AM_URL = "http://ccd-case-document-am-api-aat.service.core-compute-aat.internal"
env.TEST_DOCUMENT_MANAGEMENT_URL = 'http://dm-store-aat.service.core-compute-aat.internal'
env.DOCUMENT_MANAGEMENT_URL = 'http://dm-store-aat.service.core-compute-aat.internal'
env.ENVIRONMENT="aat"
}
withNightlyPipeline(type, product, component) {
env.TEST_URL = params.API_URL_TO_TEST
env.POST_HEARINGS_FEATURE = false
env.Rules = params.SecurityRules
setAatEnvVars()
env.TEST_E2E_URL_WEB = params.UI_URL_TO_TEST
loadVaultSecrets(secrets)
enableSlackNotifications('#sscs-tech')
enableFortifyScan()
enableMutationTest()
enableFullFunctionalTest()
afterAlways('fullFunctionalTest') {
runE2eTestsNightly()
}
afterSuccess('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}
def runE2eTestsNightly() {
try {
stage('Playwright tests') {
sh './gradlew runE2eTestsNightly'
}
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: "playwright-report",
reportFiles: 'index.html',
reportName: 'SSCS E2E Test Report'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'definitions/test/playwright-report/**'
}
}