Skip to content

Commit

Permalink
Add new testJobType for release (#849)
Browse files Browse the repository at this point in the history
Signed-off-by: Shelley Lambert <[email protected]>
  • Loading branch information
smlambert authored Dec 7, 2023
1 parent 7b9559c commit 8f6ba6d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 14 deletions.
29 changes: 25 additions & 4 deletions docs/UsingOurScripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ This file contains the default constants and paths used in the build scripts for
"enableTests" : true,
/*
Test targets triggered in 'nightly' build pipelines running 6 days per week
nightly + weekly to be run during a 'release' pipeline
'weekly' to be run on the weekend and 'release' from a release pipeline
*/
"nightlyDefault" : [
"sanity.openjdk",
Expand All @@ -96,15 +96,36 @@ This file contains the default constants and paths used in the build scripts for
],
/*
Test targets triggered in 'weekly' build pipelines running once per week
nightly + weekly + jck to be run during a 'release' pipeline
nightly + weekly to be run during 'evaluation weekly' pipeline
weekly + jck to be run during a 'weekly' pipeline
weekly to be run during 'evaluation weekly' pipeline
*/
"weeklyDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"extended.functional"
"extended.openjdk",
"extended.perf",
"special.functional",
"dev.openjdk",
"dev.system"
"dev.functional"
],
/*
Test targets triggered in 'release' build pipelines
release + jck to be run during a 'release' pipeline
*/
"releaseDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"extended.functional"
"extended.openjdk",
"extended.perf",
"special.functional"
]
},
// Raw content URL of this (defaults.json) file. This is so the openjdk_build_pipeline.groovy script can set user default configs when checking out to the shell script repo
Expand Down
27 changes: 19 additions & 8 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -254,52 +254,63 @@ class Builder implements Serializable {
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
* Key value is test: 'default' --- nightly build trigger 'nightly' test set, weekly build trigger or release build trigger 'nightly' + 'weekly' test sets
* Key value is test: [customized map] specified nightly and weekly test lists
* Key value is test: 'default' --- nightly build trigger 'nightly' test set, weekly build trigger 'weekly' or release build trigger 'release' test sets
* Key value is test: [customized map] specified nightly, weekly, release test lists
* Key value is test: [customized map] specified for different variant
*/
if (configuration.containsKey('test') && configuration.get('test')) {
def testJobType = 'nightly'
if (releaseType.startsWith('Weekly') || releaseType.equals('Release')) {
if (releaseType.startsWith('Weekly')) {
testJobType = 'weekly'
} else if (releaseType.equals('Release')){
testJobType = 'release'
}
if (isMap(configuration.test)) {
if (configuration.test.containsKey(variant)) {
//Test is enable for the variant
//Test is enabled for the variant
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>
} else {
testList = ((configuration.test.get(variant) as Map).get('nightly') as List<String>) + ((configuration.test as Map).get('weekly') as List<String>)
testList = (configuration.test.get(variant) as Map).get('release') as List<String>
}
} 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 = nightly + weekly
testList = release
}
}
}
} 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>
} else {
testList = ((configuration.test as Map).get('nightly') as List<String>) + ((configuration.test as Map).get('weekly') as List<String>)
testList = (configuration.test as Map).get('release') as List<String>
}
}
} 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 = nightly + weekly
testList = release
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Regeneration implements Serializable {
private final jobType

private String javaToBuild
private final List<String> defaultTestList = ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf', 'sanity.external']
private final List<String> defaultTestList = ['sanity.openjdk', 'sanity.system', 'extended.system', 'sanity.perf']

private final String EXCLUDED_CONST = 'EXCLUDED'

Expand Down
21 changes: 21 additions & 0 deletions pipelines/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@
"extended.functional"
],
"weeklyDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"sanity.external",
"extended.functional",
"extended.openjdk",
"extended.perf",
"special.functional",
"special.openjdk",
"dev.openjdk",
"dev.functional"
],
"releaseDefault" : [
"sanity.openjdk",
"sanity.system",
"extended.system",
"sanity.perf",
"sanity.functional",
"extended.functional",
"extended.openjdk",
"extended.perf",
"special.functional"
Expand Down
2 changes: 2 additions & 0 deletions pipelines/src/test/groovy/RepoHandlerTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class RepoHandlerTest {
Assertions.assertTrue(adoptJson.testDetails.enableTests instanceof Boolean)
Assertions.assertTrue(adoptJson.testDetails.nightlyDefault instanceof List)
Assertions.assertTrue(adoptJson.testDetails.weeklyDefault instanceof List)
Assertions.assertTrue(adoptJson.testDetails.releaseDefault instanceof List)
}

@Test
Expand Down Expand Up @@ -125,6 +126,7 @@ class RepoHandlerTest {
Assertions.assertTrue(userJson.testDetails.enableTests)
Assertions.assertEquals(userJson.testDetails.nightlyDefault, [ 'test1', 'test2', 'test3' ])
Assertions.assertEquals(userJson.testDetails.weeklyDefault, [ 'test4', 'test5', 'test6', "test7" ])
Assertions.assertEquals(userJson.testDetails.releaseDefault, [ 'test8', 'test9' ])
}

@Test
Expand Down
3 changes: 2 additions & 1 deletion pipelines/src/test/groovy/fakeDefaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"enableReproducibleCompare" : false,
"enableTests" : true,
"nightlyDefault" : [ "test1", "test2", "test3" ],
"weeklyDefault" : [ "test4", "test5", "test6", "test7"]
"weeklyDefault" : [ "test4", "test5", "test6", "test7"],
"releaseDefault" : [ "test8", "test9"]
},
"defaultsUrl" : "23"
}

0 comments on commit 8f6ba6d

Please sign in to comment.