-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_nightly
134 lines (120 loc) · 5.56 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
#!groovy
properties([
pipelineTriggers([cron('45 17 * * 1-5')]),
parameters([
string(name: 'RUNNING_ENV', defaultValue: 'aat', description: 'Environment to test'),
string(name: 'CCD_WEB_URL', defaultValue: 'https://manage-case.aat.platform.hmcts.net/', description: 'The URL you want to run solicitor tests against'),
])
])
@Library('Infrastructure')
import uk.gov.hmcts.contino.AppPipelineConfig
String type = 'nodejs'
String product = 'finrem'
String component = 'ccd-definitions'
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
static Map < String, Object > secret(String secretName, String envVariable) {
[$class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
envVariable: envVariable
]
}
def secrets = [
'finrem-${env}': [
secret('playwright-solicitor-username', 'PLAYWRIGHT_SOLICITOR_USERNAME'),
secret('playwright-solicitor-password', 'PLAYWRIGHT_SOLICITOR_PSWD'),
secret('playwright-respondent-sol-username', 'PLAYWRIGHT_RESPONDENT_SOL_USERNAME'),
secret('playwright-respondent-sol-password', 'PLAYWRIGHT_RESPONDENT_SOL_PSWD'),
secret('playwright-respondent-caa-username', 'PLAYWRIGHT_RESP_CAA_USERNAME'),
secret('playwright-respondent-caa-password', 'PLAYWRIGHT_RESP_CAA_PSWD'),
secret('username-solicitor', 'USERNAME_SOLICITOR'),
secret('password-solicitor', 'PASSWORD_SOLICITOR'),
secret('username-caseworker', 'USERNAME_CASEWORKER'),
secret('password-caseworker', 'PASSWORD_CASEWORKER'),
secret('fr-judge-username', 'USERNAME_JUDGE'),
secret('fr-judge-password', 'PASSWORD_JUDGE'),
secret('username-caa', 'USERNAME_CAA'),
secret('password-caa', 'PASSWORD_CAA'),
secret('username-respondent-solicitor', 'USERNAME_RESPONDENT_SOLICITOR'),
secret('idam-client-secret', 'IDAM_CLIENT_SECRET'),
secret('ccd-submission-s2s-auth-secret', 'CCD_SUBMIT_S2S_SECRET'),
secret('ccd-admin-username', 'CCD_ADMIN_USER_NAME'),
secret('ccd-admin-password', 'CCD_ADMIN_PASSWORD'),
secret('solicitor1-username', 'USERNAME_SOLICITOR1'),
secret('solicitor1-password', 'PASSWORD_SOLICITOR1'),
secret('barrister1-username', 'USERNAME_BARRISTER1'),
secret('barrister1-password', 'PASSWORD_BARRISTER1')
]
]
def pipelineConf = new AppPipelineConfig()
pipelineConf.vaultSecrets = secrets
withNightlyPipeline(type, product, component) {
env.CCD_WEB_URL = 'https://manage-case.aat.platform.hmcts.net'
env.CCD_DATA_API_URL = 'http://ccd-data-store-api-aat.service.core-compute-aat.internal'
env.XUI_ORG_WEB_URL = 'https://manage-org.aat.platform.hmcts.net'
env.NIGHTLY_TEST = 'true'
env.NODE_ENV = 'ci'
loadVaultSecrets(secrets)
enableFullFunctionalTest(180)
before('fullFunctionalTest') {
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'definitions/**/xlsx/*.xlsx'
env.ENV = 'aat'
}
afterAlways('fullFunctionalTest') {
stage('Functional playwright tests - chromium') {
try {
yarnBuilder.yarn('test:functional-chromium')
} catch (Error) {
unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
} finally {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'playwright-report',
reportFiles: 'index.html',
reportName: 'FunctionalTestReport'
])
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/tests/functionalTest/**/*'
}
}
// Firefox stage removed until run stabilized
// stage('Functional playwright tests - firefox') {
// try {
// yarnBuilder.yarn('test:functional-firefox')
// } catch (Error) {
// unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
// } finally {
// publishHTML([
// allowMissing: true,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'playwright-report',
// reportFiles: 'index.html',
// reportName: 'FunctionalTestReport'
// ])
// steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/tests/functionalTest/**/*'
// }
// }
// Webkit stage removed until run stabilized
// stage('Functional playwright tests - webkit') {
// try {
// yarnBuilder.yarn('test:functional-webkit')
// } catch (Error) {
// unstable(message: "${STAGE_NAME} is unstable: " + Error.toString())
// } finally {
// publishHTML([
// allowMissing: true,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'playwright-report',
// reportFiles: 'index.html',
// reportName: 'FunctionalTestReport'
// ])
// steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/tests/functionalTest/**/*'
// }
// }
}
}