-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile_nightly
130 lines (110 loc) · 4.43 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
#!groovy
properties([
pipelineTriggers([cron('H 17 * * 1-5')]),
parameters([
string(name: 'FRONTEND_URL', defaultValue: 'https://manage-case.aat.platform.hmcts.net',
description: 'The URL you want to run the full functional tests against'),
string(name: 'CASE_SERVICE_URL', defaultValue: 'http://fpl-case-service-aat.service.core-compute-aat.internal',
description: 'The URL of case service callbacks'),
string(name: 'IDAM_API_URL', defaultValue: 'https://idam-api.aat.platform.hmcts.net',
description: 'The URL of idam api'),
string(name: 'SWANSEA_ORG_ID', defaultValue: '62LYJRF',
description: 'The organisation id of Swansea local authority'),
string(name: 'FUNCTIONAL_TESTS_WORKERS',
defaultValue: '8',
description: 'Number of workers running functional tests'),
])
])
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineConfig
def type = 'java'
def product = 'fpl'
def component = 'case-service'
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
AppPipelineConfig pipelineConf;
def integrationTestSecrets = [
'fpl-aat': [
secret('integration-test-notify-service-key', 'INTEGRATION_TEST_NOTIFY_SERVICE_KEY'),
secret('docmosis-api-key', 'INTEGRATION_TEST_DOCMOSIS_TORNADO_KEY')
]
]
static Map<String, Object> secret(String secretName, String envVariable) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
envVariable: envVariable
]
}
def setupSecretsForIntegrationTests(pipelineConf) {
withSubscription('nonprod') {
withTeamSecrets(pipelineConf, 'aat') {
/* Setup Email template integration tests key with gov.notify */
env.INTEGRATION_TEST_NOTIFY_SERVICE_KEY = "${INTEGRATION_TEST_NOTIFY_SERVICE_KEY}"
/* Setup Docmosis template integration tests key and url */
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_KEY = "${INTEGRATION_TEST_DOCMOSIS_TORNADO_KEY}"
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_URL = "https://docmosis.aat.platform.hmcts.net"
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_OUTPUT_FOLDER = "${WORKSPACE}/build/docmosis-generated"
}
}
}
def archiveExtraFilesForIntegrationTests() {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: "build/docmosis-generated/**/*"
}
def teardownSecretsForIntegrationTests() {
env.INTEGRATION_TEST_NOTIFY_SERVICE_KEY = ''
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_KEY = ''
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_URL = ''
env.INTEGRATION_TEST_DOCMOSIS_TORNADO_OUTPUT_FOLDER = ''
}
withNightlyPipeline(type, product, component) {
pipelineConf = config;
env.URL = params.FRONTEND_URL
env.URL_FOR_SECURITY_SCAN = params.CASE_SERVICE_URL
env.IDAM_API_URL=params.IDAM_API_URL
env.CASE_SERVICE_URL=params.CASE_SERVICE_URL
env.SECURITY_RULES = params.SECURITY_RULES
env.ORG_ID = params.ORG_ID
loadVaultSecrets(integrationTestSecrets)
//enableMutationTest()
enableFullFunctionalTest(240)
// 'microsoft' and 'safari' to be returned to crossbrowser tests once FPLA-3172 improvements are complete
//enableCrossBrowserTest(['chrome', 'firefox'])
enableFortifyScan('fpl-aat')
before('mutationTest') {
setupSecretsForIntegrationTests(pipelineConf)
}
after('mutationTest') {
archiveExtraFilesForIntegrationTests()
teardownSecretsForIntegrationTests()
}
before('fullFunctionalTest') {
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
env.PARALLEL_CHUNKS = params.FUNCTIONAL_TESTS_WORKERS
env.MOCKED_PAYMENTS = false
env.TEST_RETRIES = 5
env.TESTS_FOR_ACCESSIBILITY = true
env.ENV = 'aat'
env.CASE_SERVICE_URL = "http://fpl-case-service-aat.service.core-compute-aat.internal"
}
before('crossBrowserTest') {
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
env.TEST_RETRIES = 5
env.TESTS_FOR_ACCESSIBILITY = false
env.ENV = 'aat'
}
afterAlways('fullFunctionalTest') {
yarnBuilder.yarn('test:functional-nightly')
archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
archiveArtifacts allowEmptyArchive: true, artifacts: '**/test-results/functionalTest/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
env.TESTS_FOR_ACCESSIBILITY = false
}
afterAlways('crossBrowserTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}