-
-
Notifications
You must be signed in to change notification settings - Fork 314
/
testJobTemplate
491 lines (456 loc) · 28.6 KB
/
testJobTemplate
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
#!groovy
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* A template that defines a test job.
*/
def getBaseJDKImpl(JDK_IMPL) {
if (JDK_IMPL != "openj9" && JDK_IMPL != "ibm" ) {
return "hotspot"
}
return JDK_IMPL
}
if (!binding.hasVariable('JDK_IMPL')) JDK_IMPL = "openj9"
if (!binding.hasVariable('ARCHIVE_TEST_RESULTS')) ARCHIVE_TEST_RESULTS = false
if (!binding.hasVariable('ARTIFACTORY_SERVER')) ARTIFACTORY_SERVER = ""
if (!binding.hasVariable('ARTIFACTORY_REPO')) ARTIFACTORY_REPO = ""
if (!binding.hasVariable('ARTIFACTORY_ROOT_DIR')) ARTIFACTORY_ROOT_DIR = ""
if (!binding.hasVariable('TEST_TIME')) TEST_TIME = ""
if (!binding.hasVariable('TIME_LIMIT')) TIME_LIMIT = "10"
if (!binding.hasVariable('TRSS_URL')) TRSS_URL = ""
if (!binding.hasVariable('SUFFIX')) SUFFIX = ""
if (!binding.hasVariable('JCK_GIT_REPO')) JCK_GIT_REPO = ""
if (!binding.hasVariable('JCK_GIT_REPO_PREFIX')) JCK_GIT_REPO_PREFIX = ""
if (!binding.hasVariable('JCK_GIT_BRANCH')) JCK_GIT_BRANCH = "master"
if (!binding.hasVariable('SSH_AGENT_CREDENTIAL')) SSH_AGENT_CREDENTIAL = ""
if (!binding.hasVariable('KEEP_REPORTDIR')) KEEP_REPORTDIR = true
if (!binding.hasVariable('AUTO_DETECT')) AUTO_DETECT = true
if (!binding.hasVariable('USE_JRE')) USE_JRE = false
if (!binding.hasVariable('TEST_JOB_NAME')) TEST_JOB_NAME = ""
if (!binding.hasVariable('TARGET')) TARGET = ""
if (!binding.hasVariable('BUILD_LIST')) BUILD_LIST = ""
if (!binding.hasVariable('SDK_RESOURCE')) SDK_RESOURCE = "upstream"
if (!binding.hasVariable('CUSTOMIZED_SDK_URL_CREDENTIAL_ID')) CUSTOMIZED_SDK_URL_CREDENTIAL_ID = ""
if (!binding.hasVariable('DOCKER_REGISTRY_URL')) DOCKER_REGISTRY_URL = ""
if (!binding.hasVariable('DOCKER_REGISTRY_DIR')) DOCKER_REGISTRY_DIR = ""
if (!binding.hasVariable('DOCKER_REGISTRY_URL_CREDENTIAL_ID')) DOCKER_REGISTRY_URL_CREDENTIAL_ID = ""
if (!binding.hasVariable('BASE_DOCKER_REGISTRY_CREDENTIAL_ID')) BASE_DOCKER_REGISTRY_CREDENTIAL_ID = ""
if (!binding.hasVariable('SLACK_CHANNEL')) SLACK_CHANNEL = ""
if (!binding.hasVariable('TRIGGER_SCHEDULE')) TRIGGER_SCHEDULE = ""
if (!binding.hasVariable('LIGHT_WEIGHT_CHECKOUT')) LIGHT_WEIGHT_CHECKOUT = true
if (!binding.hasVariable('NUM_MACHINES')) NUM_MACHINES = ""
if (!binding.hasVariable('JDK_REPO')) JDK_REPO = ""
if (!binding.hasVariable('JDK_BRANCH')) JDK_BRANCH = ""
if (!binding.hasVariable('VENDOR_TEST_REPOS')) VENDOR_TEST_REPOS = ""
if (!binding.hasVariable('VENDOR_TEST_BRANCHES')) VENDOR_TEST_BRANCHES = ""
if (!binding.hasVariable('VENDOR_TEST_DIRS')) VENDOR_TEST_DIRS = ""
if (!binding.hasVariable('USER_CREDENTIALS_ID')) USER_CREDENTIALS_ID = ""
if (!binding.hasVariable('GENERATE_JOBS')) GENERATE_JOBS = false
if (!binding.hasVariable('CLOUD_PROVIDER')) CLOUD_PROVIDER = ""
if (!binding.hasVariable('RERUN_ITERATIONS')) RERUN_ITERATIONS = "0"
if (!binding.hasVariable('JENKINS_KEY')) JENKINS_KEY = ""
if (!binding.hasVariable('RELATED_NODES')) RELATED_NODES = ""
if (!binding.hasVariable('ADDITIONAL_ARTIFACTS_REQUIRED')) ADDITIONAL_ARTIFACTS_REQUIRED = ""
if (!binding.hasVariable('DYNAMIC_COMPILE')) DYNAMIC_COMPILE = false
if (!binding.hasVariable('BUILDS_TO_KEEP')) {
BUILDS_TO_KEEP = 10
} else {
BUILDS_TO_KEEP = BUILDS_TO_KEEP.toInteger()
}
if (!binding.hasVariable('DAYS_TO_KEEP')) {
DAYS_TO_KEEP = 60
} else {
DAYS_TO_KEEP = DAYS_TO_KEEP.toInteger()
}
if (binding.hasVariable('LEVELS')) {
LEVELS = LEVELS.split(',')
} else {
// 'sanity','extended','special'
LEVELS = ['sanity']
}
if (binding.hasVariable('JDK_VERSIONS')) {
JDK_VERSIONS = JDK_VERSIONS.split(',')
} else {
JDK_VERSIONS = [8]
}
if (binding.hasVariable('GROUPS')) {
GROUPS = GROUPS.split(',')
} else {
// 'functional','system','openjdk', 'perf', 'external', 'jck'
GROUPS = ['functional']
}
if (binding.hasVariable('ARCH_OS_LIST')) {
ARCH_OS_LIST = ARCH_OS_LIST.split(',')*.trim()
} else {
ARCH_OS_LIST = [
'arm_linux',
'aarch64_linux',
'ppc64_aix',
'ppc64le_linux',
's390x_linux',
's390x_zos',
'x86-32_windows',
'x86-64_linux',
'x86-64_linux_xl',
'x86-64_mac',
'x86-64_mac_xl',
'x86-64_windows'
]
}
JDK_IMPL_SN = JDK_IMPL
JDK_IMPL_BASE = getBaseJDKImpl(JDK_IMPL)
if (JDK_IMPL == "openj9") {
JDK_IMPL_SN = "j9"
} else if (JDK_IMPL == "hotspot") {
JDK_IMPL_SN = "hs"
}
// If user specifies a PARALLEL_DEFAULT option, prepend it to the list so it becomes the default in the generated job(s)
PARALLEL_LIST = ['None', 'Dynamic', 'NodesByIterations']
if (binding.hasVariable('PARALLEL_DEFAULT')) {
PARALLEL_LIST.remove(PARALLEL_DEFAULT)
PARALLEL_LIST.add(0, PARALLEL_DEFAULT)
}
println "LEVELS: ${LEVELS}"
println "JDK_VERSIONS: ${JDK_VERSIONS}"
println "GROUPS: ${GROUPS}"
println "ARCH_OS_LIST: ${ARCH_OS_LIST}"
def OPENJ9_REPO = "https://github.com/eclipse-openj9/openj9.git"
def ADOPTOPENJDK_REPO = "https://github.com/adoptium/aqa-tests.git"
def ADOPTOPENJDK_BRANCH = "master"
def USE_TESTENV_PROPERTIES = false
def SETUP_JCK_RUN = false
// https://issues.jenkins.io/browse/JENKINS-42971 is resolved, but it seems to be a partial fix for Branch Specifier parameter.
// Repository URL still has problem with lightweight checkout
// Set Repository URL and Branch Specifier as build parameters by default
// If LIGHT_WEIGHT_CHECKOUT is set to true, set Repository URL to its explicit value and keep Branch Specifier as parameter
def ADOPTOPENJDK_REPO_BUILD_PARAM = '${ADOPTOPENJDK_REPO}'
def ADOPTOPENJDK_BRANCH_BUILD_PARAM = '${ADOPTOPENJDK_BRANCH}'
def SCRIPT_PATH = "aqa-tests/buildenv/jenkins/openjdk_tests"
LIGHT_WEIGHT_CHECKOUT = LIGHT_WEIGHT_CHECKOUT.toBoolean()
if (LIGHT_WEIGHT_CHECKOUT) {
ADOPTOPENJDK_REPO_BUILD_PARAM = ADOPTOPENJDK_REPO
SCRIPT_PATH = "buildenv/jenkins/openjdk_tests"
}
String sectionHeaderStyleCss = ' color: blue; font-family: Roboto, sans-serif !important; padding: 5px; font-weight: bold; margin-top: 0.5rem; font-size: 1rem; outline: 0; '
String separatorStyleCss = ' border: 0; border-bottom: 1px solid #ccc; '
String sectionHeaderHelpTextStyleCss = ' color: #444; font-family: Roboto, sans-serif !important; outline: 0; display: block; font-weight: bold; padding-left: 5px; margin-bottom: 1rem'
String separatorHelpTextStyleCss = ' border: none; margin-top: 0; margin-bottom: 0 '
ARCH_OS_LIST.each { ARCH_OS ->
JDK_VERSIONS.each { JDK_VERSION ->
LEVELS.each { LEVEL ->
GROUPS.each { GROUP ->
def ACTUAL_TEST_JOB_NAME = TEST_JOB_NAME ? TEST_JOB_NAME : "Test_openjdk${JDK_VERSION}_${JDK_IMPL_SN}_${LEVEL}.${GROUP}_${ARCH_OS}${SUFFIX}"
def ACTUAL_TARGET = TARGET ? TARGET : "${LEVEL}.${GROUP}"
def ACTUAL_BUILD_LIST = BUILD_LIST ? BUILD_LIST : GROUP
// for jck builds, if JCK_GIT_REPO_PREFIX is set, set JCK_GIT_REPO if it is not set
def ACTUAL_JCK_GIT_REPO = JCK_GIT_REPO ?: ""
if (GROUP == "jck" && JCK_GIT_REPO_PREFIX && !ACTUAL_JCK_GIT_REPO) {
ACTUAL_JCK_GIT_REPO = "${JCK_GIT_REPO_PREFIX}/JCK${JDK_VERSION}-unzipped.git"
}
def BUILDS_TO_KEEP_MULTIPLIER = 1
if (ACTUAL_TEST_JOB_NAME.contains('_imageUpload') || ACTUAL_TEST_JOB_NAME.contains('_imagePull')) {
BUILDS_TO_KEEP_MULTIPLIER = 5
}
def ACTUAL_BUILDS_TO_KEEP = BUILDS_TO_KEEP * BUILDS_TO_KEEP_MULTIPLIER
def DOCKER_REQUIRED = false
def DOCKERIMAGE_TAG = ""
def EXTRA_DOCKER_ARGS = ""
if (GROUP == "external") {
if (LEVEL != "dev") {
DOCKER_REQUIRED = true
}
DOCKERIMAGE_TAG = "nightly"
EXTRA_DOCKER_ARGS = '-v ${TEST_JDK_HOME}:/opt/java/openjdk'
}
pipelineJob("$ACTUAL_TEST_JOB_NAME") {
description('<h1>THIS IS AN AUTOMATICALLY GENERATED JOB. PLEASE DO NOT MODIFY, IT WILL BE OVERWRITTEN.</h1><br><p>This job is defined in <a href="https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/testJobTemplate" target="_blank">testJobTemplate</a> in the https://github.com/adoptium/aqa-tests repo. If you wish to change the job, please modify testJobTemplate script. </p><p>For more information about job parameters, please refer <a href="https://github.com/adoptium/aqa-tests/wiki/How-to-Run-a-Grinder-Build-on-Jenkins" target="_blank">How to Run a Grinder Build on Jenkins</a></p>wiki:<p><a href="https://github.com/eclipse-openj9/openj9/wiki/AQA-Lightning-Talk-Series" target="_blank">AQA Lightning Talk Series</a></p><p><a href="https://github.com/eclipse-openj9/openj9/wiki/Reproducing-Test-Failures-Locally" target="_blank">Reproducing Test Failures Locally</a></p>')
properties {
pipelineTriggers {
triggers {
cron {
spec(TRIGGER_SCHEDULE)
}
}
}
copyArtifactPermission {
projectNames('*')
}
}
definition {
parameters {
parameterSeparatorDefinition {
name('TEST_REPO_PARAMS')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Test Repositories Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('TEST_REPO_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Repositories where we pull test material from. Unless you are testing test code, these do not need to be changed.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
stringParam('ADOPTOPENJDK_REPO', ADOPTOPENJDK_REPO, "AdoptOpenJDK git repo. Please use ssh for zos.")
stringParam('ADOPTOPENJDK_BRANCH', ADOPTOPENJDK_BRANCH, "AdoptOpenJDK branch")
stringParam('OPENJ9_REPO', OPENJ9_REPO, "OpenJ9 git repo. Please use ssh for zos.")
stringParam('OPENJ9_BRANCH', "master", "OpenJ9 branch")
stringParam('OPENJ9_SHA', "", "OpenJ9 sha")
stringParam('JDK_REPO', JDK_REPO, "JDK git repo. Please use ssh for zos.")
stringParam('JDK_BRANCH', JDK_BRANCH, "JDK branch")
stringParam('OPENJDK_SHA', "", "OpenJDK SHA from which to run tests")
stringParam('TKG_OWNER_BRANCH', "adoptium:master", "TestKitGen git [owner]:[branch]. Default is adoptium:master")
stringParam('ADOPTOPENJDK_SYSTEMTEST_OWNER_BRANCH', "adoptium:master", "Personal Adoptium/aqa-systemtest repository owner:branch")
stringParam('OPENJ9_SYSTEMTEST_OWNER_BRANCH', "eclipse:master", "Personal eclipse-openj9/openj9-systemtest repository owner:branch")
stringParam('STF_OWNER_BRANCH', "adoptium:master", "Personal stf repo owner:branch")
stringParam('JCK_GIT_REPO', ACTUAL_JCK_GIT_REPO, "JCK git repo. For JCK test only")
stringParam('JCK_GIT_BRANCH', JCK_GIT_BRANCH, "JCK branch. For JCK test only")
parameterSeparatorDefinition {
name('NON_AQA_TEST_REPOS_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Non-AQA Test Repositories')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('NON_AQA_TEST_REPOS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Additional test repositories that can be overlayed onto existing AQA test material for extra testing.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
stringParam('VENDOR_TEST_REPOS', VENDOR_TEST_REPOS, "Optional. Addtional test repos")
stringParam('VENDOR_TEST_BRANCHES', VENDOR_TEST_BRANCHES, "Optional. Addtional test branches")
stringParam('VENDOR_TEST_SHAS', "", "Optional. Addtional test shas")
stringParam('VENDOR_TEST_DIRS', VENDOR_TEST_DIRS, "Optional. Addtional test dirs")
stringParam('USER_CREDENTIALS_ID', USER_CREDENTIALS_ID, "Optional. User credential ID")
parameterSeparatorDefinition {
name('PLATFORM_AND_MACHINE_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Platform and Machine Selection Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('PLATFORM_AND_MACHINE_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Choose which platform to run tests on, and optionally specify machine label to send the test job to a certain machine is desired.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
stringParam('PLATFORM', "${ARCH_OS}", '''Platform to be tested:
<br/>arm_linux
<br/>aarch64_linux
<br/>ppc64_aix
<br/>ppc64le_linux
<br/>s390x_linux
<br/>s390x_zos
<br/>x86-64_linux
<br/>x86-64_mac
<br/>x86-64_windows
<br/>x86-32_windows
<br/>sparcv9_solaris
<br/>riscv64_linux
<br/>multiple platforms (comma separated values): x86-64_linux,x86-64_mac
<br/>all platforms: all (this set actually excludes some secondary platforms and varies based on JDK_VERSION/JDK_IMPL selected)
<br/>all OS-constrained platforms (only platforms already supported by "all" can be executed):
<br/>all_linux
<br/>all_mac
<br/>all_windows
<br/>all_aix
<br/>Please refer to PLATFORM_MAP in https://github.com/adoptium/aqa-tests/blob/master/buildenv/jenkins/openjdk_tests<br/>''')
stringParam('LABEL', "", "Jenkins node label to run on. Leave this blank for the default value specified in PLATFORM_MAP. Set to node name to run on a particular machine.")
stringParam('LABEL_ADDITION', "", "Additional label(s) to append to LABEL. Usually when you want to add a label to the default value.")
booleanParam('DOCKER_REQUIRED', DOCKER_REQUIRED, "Is docker required? True, if BUILD_LIST contains external.")
stringParam('DOCKERIMAGE_TAG', DOCKERIMAGE_TAG, "Docker image tag")
stringParam('EXTRA_DOCKER_ARGS', EXTRA_DOCKER_ARGS, "Extra docker args")
stringParam('SSH_AGENT_CREDENTIAL', SSH_AGENT_CREDENTIAL, "Optional. Only use when ssh credentials are needed")
stringParam('ACTIVE_NODE_TIMEOUT', "", "Number of minutes we will wait for a label-matching node to become active.")
stringParam('CLOUD_PROVIDER', CLOUD_PROVIDER, "Available cloud provider, e.g. azure, fyre")
parameterSeparatorDefinition {
name('JDK_SELECTION_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('JDK Selection Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('JDK_SELECTION_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Specify where to pick up JDK from and provide extra details if taking from upstream or customized.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
stringParam('SDK_RESOURCE', SDK_RESOURCE, '''Where to get sdk? nightly|releases|customized|upstream<br/>
nightly & releases pull the lastest from https://api.adoptium.net/ <br/>
If nightly / releases is selected, please provide JDK_VERSION and JDK_IMPL <br/>
If customized is selected, please provide CUSTOMIZED_SDK_URL (and CUSTOMIZED_SDK_URL_CREDENTIAL_ID if the URL has restricted access)<br/>
If upstream is selected, please provide UPSTREAM_JOB_NAME and UPSTREAM_JOB_NUMBER <br/>''')
stringParam('JDK_VERSION', "${JDK_VERSION}", "JDK version. i.e., 8, 11")
stringParam('JDK_IMPL', JDK_IMPL_BASE, "JDK Base implementation, e.g. hotspot, openj9")
stringParam('CUSTOMIZED_SDK_URL', "", "Customized SDK url, need to set when SDK_RESOURCE=customized")
stringParam('CUSTOMIZED_SDK_URL_CREDENTIAL_ID', CUSTOMIZED_SDK_URL_CREDENTIAL_ID, "Only use this if you are pulling an JDK from a site that needs credential")
stringParam('ADDITIONAL_ARTIFACTS_REQUIRED', ADDITIONAL_ARTIFACTS_REQUIRED, "Optional. Only use this to specify the type of additional artifacts")
stringParam('DOCKER_REGISTRY_URL', DOCKER_REGISTRY_URL, "Only use this if you need to access a docker registry")
stringParam('DOCKER_REGISTRY_DIR', DOCKER_REGISTRY_DIR, "Only use this if you need to specify the directory in docker registry")
stringParam('DOCKER_REGISTRY_URL_CREDENTIAL_ID', DOCKER_REGISTRY_URL_CREDENTIAL_ID, "Only use this if the docker registry you access needs credential")
stringParam('BASE_DOCKER_REGISTRY_CREDENTIAL_ID', BASE_DOCKER_REGISTRY_CREDENTIAL_ID, "Only use this if base docker registry credential is needed to avoid reach limit")
stringParam('UPSTREAM_JOB_NAME', "", '''Upstream job name from the same Jenkins server to download JDK. e.g., UploadFile<br/>
Only set when SDK_RESOURCE=upstream. It has to be used together with UPSTREAM_JOB_NUMBER <br/>''')
stringParam('UPSTREAM_JOB_NUMBER', "", '''Upstream job number from the same Jenkins server to download JDK. e.g., 40<br/>
Only set when SDK_RESOURCE=upstream. It has to be used together with UPSTREAM_JOB_NAME <br/>''')
booleanParam('USE_JRE', USE_JRE.toBoolean(), "Optional. Default is set to false. If set to true, CUSTOMIZED_SDK_URL must include the JDK link (used to compile test material) followed by a space and then the JRE link (used in test execution).")
booleanParam('AUTO_DETECT', AUTO_DETECT.toBoolean(), "Optional. Default is to enable AUTO_DETECT")
parameterSeparatorDefinition {
name('TEST_SELECTION_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Test Selection Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('TEST_SELECTION_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Provide parameters for which test material to build and which test targets to run.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
stringParam('BUILD_LIST', "${ACTUAL_BUILD_LIST}", '''Specific test directories to compile. This can be a comma-separated list of directories. <br/>Advisable to specify to a granularity that suits the targets you want to run. BUILD_LIST value can be the following:<br/>top level folder: openjdk|system|perf|jck|external|functional<br/>sub-folder: functional/Java8andUp|perf/dacapo<br/>multiple folders: system,functional<br/>''')
booleanParam('DYNAMIC_COMPILE', DYNAMIC_COMPILE.toBoolean(), '''WIP. It only works with functional tests atm. <br/>
Optional. Use DYNAMIC_COMPILE to automatically compile the required test material.<br/>
When DYNAMIC_COMPILE is on: <br/>
- if there is no BUILD_LIST input, DYNAMIC_COMPILE will automatically figure out which test material to compile based on the test target.<br/>
- if there is BUILD_LIST input, the BUILD_LIST will be further refined based on the test target.''')
stringParam('TARGET', "${ACTUAL_TARGET}",
'''Test TARGET to execute, you can also select sub-targets such as:<br/>
different level: sanity|extended|special<br/>
different group: openjdk|system|jck|functional|perf|external<br/>
level.group: sanity.functional<br/>
individual test in playlist.xml: floatSanityTests|MiniMix_5m|jdk_math|jdk_beans_0|jdk_custom<br/>
a list of tests: testList TESTLIST=jit_jitt,jit_recognizedMethod_1,testSCCMLTests2_1<br/>
Note: please do not use level, group or type (i.e., functional, sanity, etc) in the TESTLIST<br/>''')
stringParam('CUSTOM_TARGET', "",
'''Only used when the custom target is specified in TARGET , e.g. jdk_custom, langtools_custom, system_custom, etc., CUSTOM_TARGET=path to the test class to execute (typically ending in .java or .sh)<br>
Example 1:<br>
TARGET=system_custom<br>
CUSTOM_TARGET=-test=MathLoadTest -test-args="workload=math,timeLimit=5m"<br>
Example 2:<br>
TARGET=jdk_custom (support multiple test cases separated by space, hotspot_custom works same<br>
CUSTOM_TARGET=test/jdk/java/math/BigInteger/LargeValueExceptions.java java/math/BigInteger/BigIntegerTest.java<br>
Example 3:<br>
TARGET=jckruntime_custom<br>
CUSTOM_TARGET=lang/INFR/....html<br>''')
parameterSeparatorDefinition {
name('TEST_OPTIONS_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Provide parameters for which test material to build and which test targets to run.')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('TEST_OPTIONS_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Additional test parameters if you want to append or replace options, or repeat the test for more than 1 iteration.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
choiceParam('TEST_FLAG', ['', 'JITAAS', 'AOT', 'FIPS', 'FIPS140_2', 'FIPS140_3_OpenJCEPlusFIPS', 'FIPS140_3_OpenJCEPlusFIPS.FIPS140-3'], "Optional. Only set for feature testing. (i.e., JITAAS, AOT, FIPS140_2, etc)")
stringParam('EXTRA_OPTIONS', "", "Use this to append options to the test command e.g. to add extra JVM flags")
stringParam('JVM_OPTIONS', "", "Use this to replace the original options to the test command e.g. to override JVM flags")
stringParam('APPLICATION_OPTIONS', "", "Use this to append options to the test application")
stringParam('BUILD_IDENTIFIER', "", "build identifier")
stringParam('ITERATIONS',"1", '''Optional. Number of times to repeat execution of make target. <br/>
Use ITERATIONS with PARALLEL=None, run the same test(s) in a loop on one machine <br/>
Use ITERATIONS and NUM_MACHINES with PARALLEL=NodesByIterations, run the same test(s) in x (NUM_MACHINES) parallel runs with y (ITERATIONS) in each run<br/>''')
stringParam('TIME_LIMIT', TIME_LIMIT, "time limit")
parameterSeparatorDefinition {
name('TEST_PARALLELIZATION_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Test Parallelization Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('TEST_PARALLELIZATION_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Additional test options if you wish to run in various parallel modes')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
choiceParam('PARALLEL', PARALLEL_LIST, '''Optional. Parallel mode: <br/>
None // run test(s) in serial <br/>
Dynamic // dynamically divides tests according to NUM_MACHINES or TEST_TIME and runs them in parallel. Please also provide NUM_MACHINES or TEST_TIME. <br/>
NodesByIterations // run the same test(s) in parallel according to NUM_MACHINES. You can also provide ITERATIONS. This is mainly for debugging intermittent issues. <br/>''')
stringParam('NUM_MACHINES', NUM_MACHINES, '''Optional. It has to be used with PARALLEL=Dynamic or PARALLEL=NodesByIterations<br/>
Use with PARALLEL=Dynamic, NUM_MACHINES cannot be greater than the number of matched nodes on Jenkins<br/>
Use with PARALLEL=NodesByIterations, NUM_MACHINES cannot be greater than 20<br/>''')
stringParam('TEST_TIME', TEST_TIME, '''Optional. Expected overall test build execution time. Needs to be used with PARALLEL=Dynamic.<br>
Once TEST_TIME is provided, test pipeline will automatically run tests in parallel and try to achieve the expected TEST_TIME.<br>
To ensure a balanced workload in test child builds, please also provide TRSS_URL.<br>
If both NUM_MACHINES and TEST_TIME are provided, only NUM_MACHINES will be used.<br>''')
stringParam('TRSS_URL', TRSS_URL, '''Optional. Active TRSS server to fetch test execution time. Needs to be used with PARALLEL=Dynamic.<br>
If not provided, the default is https://trss.adoptium.net <br>''')
stringParam('UPSTREAM_TEST_JOB_NAME', "", "Auto-populated. Upstream test job name. It will be used together with PARALLEL=Dynamic")
stringParam('UPSTREAM_TEST_JOB_NUMBER', "", "Auto-populated. Upstream test job number. It will be used together with PARALLEL=Dynamic")
booleanParam('GENERATE_JOBS', GENERATE_JOBS.toBoolean(), "Force generate child jobs?")
booleanParam('LIGHT_WEIGHT_CHECKOUT', LIGHT_WEIGHT_CHECKOUT.toBoolean(), '''Optional. It takes effects if GENERATE_JOBS sets to true. <br>
If LIGHT_WEIGHT_CHECKOUT sets to true, generated job will check out faster. But the generated child job will NOT take ADOPTOPENJDK_REPO and ADOPTOPENJDK_BRANCH as parameters in job configure. <br>
If LIGHT_WEIGHT_CHECKOUT sets to false, the generated child job will take user-provided ADOPTOPENJDK_REPO and ADOPTOPENJDK_BRANCH in job configure. <br>
LIGHT_WEIGHT_CHECKOUT is expected to be set to false for Grinder. For regular nightly/weekly runs, the value is expected to be set to true.<br>''')
parameterSeparatorDefinition {
name('POST_RUN_PARAMS')
separatorStyle(separatorStyleCss)
sectionHeader('Post Run Parameters')
sectionHeaderStyle(sectionHeaderStyleCss)
}
parameterSeparatorDefinition {
name('POST_RUN_PARAMS_HELP_TEXT')
separatorStyle(separatorHelpTextStyleCss)
sectionHeader('Parameters to determine what to do with post run artifacts.')
sectionHeaderStyle(sectionHeaderHelpTextStyleCss)
}
booleanParam('KEEP_WORKSPACE', false, "Keep workspace on the machine")
booleanParam('KEEP_REPORTDIR', KEEP_REPORTDIR.toBoolean(), "TKG will keep the test report dir if the test passes. Set true for OpenJDK junit results")
booleanParam('ARCHIVE_TEST_RESULTS', ARCHIVE_TEST_RESULTS.toBoolean(), "archive the test report dir in Jenkins (or artifactory if artifactory parameters are provided)?")
stringParam('ARTIFACTORY_SERVER', ARTIFACTORY_SERVER, "Optional. Default is to upload test output (failed build) onto artifactory only. By unset this value, test output will be archived to Jenkins")
stringParam('ARTIFACTORY_REPO', ARTIFACTORY_REPO, "Optional. It should be used with ARTIFACTORY_SERVER")
stringParam('ARTIFACTORY_ROOT_DIR', ARTIFACTORY_ROOT_DIR, "Optional. It should be used with ARTIFACTORY_SERVER and ARTIFACTORY_REPO. Default is to set root dir to be the same as the current Jenkins domain")
stringParam('SLACK_CHANNEL', SLACK_CHANNEL, "Slack channel. e.g., #rt-jenkins")
booleanParam('PERSONAL_BUILD', false, "Is this a personal build?")
booleanParam('USE_TESTENV_PROPERTIES', USE_TESTENV_PROPERTIES.toBoolean(), "use properties defined in the testenv.properties")
stringParam('RERUN_ITERATIONS', RERUN_ITERATIONS, "Optional. Number of times to repeat execution of failed test target(s).")
booleanParam('SETUP_JCK_RUN', SETUP_JCK_RUN.toBoolean(), "setup jdk during release for jck interactive run")
stringParam('JENKINS_KEY', JENKINS_KEY, "Optional. Only use this for Multi-node Compiler TCK tests")
stringParam('RELATED_NODES', RELATED_NODES, "Optional. Only use this for reserving secondary nodes other than current")
}
cpsScm {
scm {
git {
remote {
url(ADOPTOPENJDK_REPO_BUILD_PARAM)
}
branch(ADOPTOPENJDK_BRANCH_BUILD_PARAM)
extensions {
relativeTargetDirectory('aqa-tests')
cleanBeforeCheckout()
pruneStaleBranch()
wipeOutWorkspace()
cloneOptions {
depth(1)
shallow(true)
timeout(60)
}
}
}
scriptPath(SCRIPT_PATH)
lightweight(LIGHT_WEIGHT_CHECKOUT)
}
}
logRotator {
numToKeep(ACTUAL_BUILDS_TO_KEEP)
artifactNumToKeep(ACTUAL_BUILDS_TO_KEEP)
daysToKeep(DAYS_TO_KEEP)
artifactDaysToKeep(DAYS_TO_KEEP)
}
}
}
}
}
}
}