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 Mar 11, 2024
1 parent a1bf8c1 commit d442c47
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
44 changes: 43 additions & 1 deletion pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,47 @@ class Build {

return jdkRepo
}

private String allocateEBCnodesForTest(testType) {
def platform = buildConfig.TARGET_OS + '_' + buildConfig.ARCHITECTURE
// 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

context.println "EBC info: ---------platform: ${platform} testType: ${testType} ----------"
context.println "--------------DEFAULTS_JSON['testDetails']----------------"
context.println DEFAULTS_JSON['testDetails']
context.println "--------------DEFAULTS_JSON['testDetails']['ebcEnabledTargets']----------------"
context.println DEFAULTS_JSON['testDetails']['ebcEnabledTargets']
context.println "--------------DEFAULTS_JSON['testDetails']['ebcEnabledTargets'][platform]----------------"
context.println DEFAULTS_JSON['testDetails']['ebcEnabledTargets'][platform]
context.println "------------------------------"
if ( ! DEFAULTS_JSON['testDetails']['ebcEnabledTargets'][platform].find { it == testType } ) {
context.println "EBC does not support for $platform->$testType yet!"
return ''
}

// context.library 'jenkins-ci-websphere'
def group_label_UUID = 'semeru_aqatest_machine_' + UUID.randomUUID().toString()
def num_machines = '1'
def test_index = DEFAULTS_JSON['testDetails']['defaultDynamicParas']['testLists'].indexOf(testType)
if (test_index != -1){
num_machines = DEFAULTS_JSON['testDetails']['defaultDynamicParas']['numMachines'].get(test_index)
}
def nodes_ebc_args = new Object[num_machines]

def jobName = '/EBC_Create_Node'
def ebcJob = context.build job: jobName,
propagate: false,
wait: false,
parameters: [
context.string(name: 'group_label', value: group_label_UUID),
context.string(name: 'platform', value: platform),
context.string(name: 'nodeType', value: 'AQA_test_node'),
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 @@ -536,7 +577,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
13 changes: 12 additions & 1 deletion pipelines/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,19 @@
],
"enableTestDynamicParallel" : true,
"defaultDynamicParas": {
"testLists" : ["sanity.functional", "extended.functional", "sanity.system", "extended.system", "special.system", "sanity.jck", "extended.jck", "sanity.openjdk", "dev.system"],
"testLists" : ["sanity.functional", "extended.functional", "sanity.system", "extended.system", "special.system", "sanity.jck", "extended.jck", "sanity.openjdk", "extended.openjdk", "dev.system"],
"numMachines" : ["3", "3", "3", "3", "5", "4", "8", "2", "5"]
},
"ebcEnabledTargets":{
"linux_x64" : ["sanity.functional"],
"aix_ppc64" : [""],
"linux_aarch64" : [""],
"linux_ppc64le" : [""],
"linux_s390x" : [""],
"mac_aarch64" : [""],
"mac_x64" : [""],
"windows-x64" : [""],
"windows-x32" : [""]
}
},
"enableInstallers" : true,
Expand Down

0 comments on commit d442c47

Please sign in to comment.