Skip to content

Commit

Permalink
Update test list logic (#896)
Browse files Browse the repository at this point in the history
* Update getTestList logic

If specific test type list is not defined, set as default

Signed-off-by: Sophia Guo <[email protected]>

* Use default test configuration for linux x64

Signed-off-by: Sophia Guo <[email protected]>

* Remove non necessary code

Signed-off-by: Sophia Guo <[email protected]>

---------

Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo authored Jan 26, 2024
1 parent 38ebd93 commit b5a858d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
55 changes: 28 additions & 27 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ class Builder implements Serializable {
We run different test categories depending on if this build is a release or nightly. This function parses and applies this to the individual build config.
*/
List<String> getTestList(Map<String, ?> configuration, String variant) {
final List<String> nightly = DEFAULTS_JSON['testDetails']['nightlyDefault']
final List<String> weekly = DEFAULTS_JSON['testDetails']['weeklyDefault']
final List<String> release = DEFAULTS_JSON['testDetails']['releaseDefault']
List<String> testList = []
/*
* No test key or key value is test: false --- test disabled
Expand All @@ -275,50 +272,54 @@ class Builder implements Serializable {
if (configuration.test.get(variant)) {
def testObj = configuration.test.get(variant)
if (isMap(testObj)) {
if (testJobType == 'nightly') {
testList = (configuration.test.get(variant) as Map).get('nightly') as List<String>
} else if (testJobType == 'weekly') {
testList = (configuration.test.get(variant) as Map).get('weekly') as List<String>
if (testObj.containsKey(testJobType)) {
testList = (configuration.test as Map).get(testJobType) as List<String>
} else {
testList = (configuration.test.get(variant) as Map).get('release') as List<String>
testList = getDefaultTestList(testJobType)
}
} else if (testObj instanceof List) {
testList = (configuration.test as Map).get(variant) as List<String>
} else {
if (testJobType == 'nightly') {
testList = nightly
} else if (testJobType == 'weekly') {
testList = weekly
} else {
testList = release
}
testList = getDefaultTestList(testJobType)
}
}
} else {
if (testJobType == 'nightly') {
testList = (configuration.test as Map).get('nightly') as List<String>
} else if (testJobType == 'weekly') {
testList = (configuration.test as Map).get('weekly') as List<String>
if (configuration.test.containsKey(testJobType)) {
testList = (configuration.test as Map).get(testJobType) as List<String>
} else {
testList = (configuration.test as Map).get('release') as List<String>
testList = getDefaultTestList(testJobType)
}
}
} else {
// Default to the test sets declared if one isn't set in the build configuration
if (testJobType == 'nightly') {
testList = nightly
} else if (testJobType == 'weekly') {
testList = weekly
} else {
testList = release
}
testList = getDefaultTestList(testJobType)
}
}

testList.unique()

return testList
}

/*
Get default test list
*/
List<String> getDefaultTestList(String testJobType) {
final List<String> nightly = DEFAULTS_JSON['testDetails']['nightlyDefault']
final List<String> weekly = DEFAULTS_JSON['testDetails']['weeklyDefault']
final List<String> release = DEFAULTS_JSON['testDetails']['releaseDefault']
List<String> testList = []

if (testJobType == 'nightly') {
testList = nightly
} else if (testJobType == 'weekly') {
testList = weekly
} else {
testList = release
}
return testList
}

/*
Get the list of tests to dynamically run parallel builds from the build configurations.
This function parses and applies this to the individual build config.
Expand Down
5 changes: 1 addition & 4 deletions pipelines/jobs/configurations/jdk11u_pipeline_config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ class Config11 {
dockerFile: [
openj9 : 'pipelines/build/dockerFiles/cuda.dockerfile'
],
test : [
nightly: ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.functional', 'extended.functional'],
weekly : ['extended.openjdk', 'extended.perf', 'special.functional', 'sanity.external']
],
test : 'default',
configureArgs : [
'openj9' : '--enable-dtrace=auto',
'temurin' : '--enable-dtrace=auto',
Expand Down

0 comments on commit b5a858d

Please sign in to comment.