Skip to content

Commit

Permalink
enables EBC for test inside semeru builds
Browse files Browse the repository at this point in the history
It add a function called allocateEBCnodesForTest which return label for new generated EBC nodes and let test use it.

Signed-off-by: Mahdi Ardekanian <[email protected]>
  • Loading branch information
mahdipub committed Feb 19, 2024
1 parent a1bf8c1 commit a0700cd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
37 changes: 35 additions & 2 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,39 @@ class Build {

return jdkRepo
}

private String allocateEBCnodesForTest(testType) {
def test_target = buildConfig.ARCHITECTURE + '_' + buildConfig.TARGET_OS
// All targets are not supported via EBC yet. We need to test that target and add to default.json later on to make it enable
if ( ! DEFAULTS_JSON['testDetails']['ebcEnabledTargets'].find { it == test_target } ) {
return ''
}

// context.library 'jenkins-ci-websphere'
def group_label_UUID = 'Adopt-semeru_test_machine_' + UUID.randomUUID().toString()
def num_machines = '0'
def test_index = DEFAULTS_JSON['testDetails']['defaultDynamicParas']['testLists'].indexOf(testType)
num_machines = DEFAULTS_JSON['testDetails']['defaultDynamicParas']['numMachines'].get(test_index)
def nodes_ebc_args = new Object[num_machines]

if (num_machines == '0' ) {
num_machines = '1'
}

def jobName = '/EBC_Create_Node'
def ebcJob = context.build job: jobName,
propagate: false,
wait: true,
parameters: [
context.string(name: 'group_label', value: group_label_UUID),
context.string(name: 'ebcPlan', value: 'hur-runtimesJenkins-ubuntu22_x86.yml'),
context.string(name: 'ebcShortlist', value: ''),
context.string(name: 'NUM_MACHINES', value: num_machines),
context.string(name: 'TIME_LIMIT', value: '3') //TODO: use estimated time via default.json instead
]
return group_label_UUID
}

/*
Run smoke tests, which should block the running of downstream test jobs if there are failures.
If a test job that doesn't exist, it will be created dynamically.
Expand Down Expand Up @@ -449,7 +482,6 @@ class Build {
}

def jobParams = getAQATestJobParams(testType)

def testFlag = ''
if (isFipsTestBuild) {
jobParams.put('TEST_JOB_NAME', "${jobParams.TEST_JOB_NAME}_fips140_2")
Expand Down Expand Up @@ -536,7 +568,8 @@ class Build {
context.string(name: 'VENDOR_TEST_DIRS', value: VENDOR_TEST_DIRS),
context.string(name: 'RERUN_ITERATIONS', value: "${rerunIterations}"),
context.string(name: 'RELATED_NODES', value: relatedNodeLabel),
context.string(name: 'ADDITIONAL_ARTIFACTS_REQUIRED', value: additionalArtifactsRequired)
context.string(name: 'ADDITIONAL_ARTIFACTS_REQUIRED', value: additionalArtifactsRequired),
context.string(name: 'LABEL', value: allocateEBCnodesForTest(testType))
],
wait: true
currentBuild.result = testJob.getResult()
Expand Down
3 changes: 2 additions & 1 deletion pipelines/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"defaultDynamicParas": {
"testLists" : ["sanity.functional", "extended.functional", "sanity.system", "extended.system", "special.system", "sanity.jck", "extended.jck", "sanity.openjdk", "dev.system"],
"numMachines" : ["3", "3", "3", "3", "5", "4", "8", "2", "5"]
}
},
"ebcEnabledTargets":["x64_linux"]
},
"enableInstallers" : true,
"enableSourceRpm" : true,
Expand Down

0 comments on commit a0700cd

Please sign in to comment.