Skip to content

Commit

Permalink
Pass smokeTest parameter VENDOR_TEST_BRANCHES as variable (#587)
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>

Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo authored Jan 17, 2023
1 parent acd72b0 commit 76febe0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,12 @@ class Build {
jobParams.put('BUILD_LIST', 'functional/buildAndPackage')
def useAdoptShellScripts = Boolean.valueOf(buildConfig.USE_ADOPT_SHELL_SCRIPTS)
def vendorTestRepos = ((String)ADOPT_DEFAULTS_JSON['repository']['build_url']) - ('.git')
def vendorTestBranches = ADOPT_DEFAULTS_JSON['repository']['build_branch']
def vendorTestDirs = ADOPT_DEFAULTS_JSON['repository']['test_dirs']
if (!useAdoptShellScripts) {
vendorTestRepos = ((String)DEFAULTS_JSON['repository']['build_url']) - ('.git')
vendorTestBranches = buildConfig.BUILD_REF ?: DEFAULTS_JSON['repository']['build_branch'] // use BUILD_CONFIGURATION's branch if exists
vendorTestDirs = DEFAULTS_JSON['repository']['test_dirs']
}
jobParams.put('VENDOR_TEST_REPOS', vendorTestRepos)
jobParams.put('VENDOR_TEST_BRANCHES', vendorTestBranches)
jobParams.put('VENDOR_TEST_DIRS', vendorTestDirs)
return jobParams
}
Expand Down Expand Up @@ -281,7 +278,12 @@ class Build {
*/
def runSmokeTests() {
def additionalTestLabel = buildConfig.ADDITIONAL_TEST_LABEL

def useAdoptShellScripts = Boolean.valueOf(buildConfig.USE_ADOPT_SHELL_SCRIPTS)
def vendorTestBranches = ADOPT_DEFAULTS_JSON['repository']['build_branch']
if (!useAdoptShellScripts) {
vendorTestBranches = buildConfig.BUILD_REF ?: DEFAULTS_JSON['repository']['build_branch'] // use BUILD_CONFIGURATION's branch if exists
}

try {
context.println 'Running smoke test'
context.stage('smoke test') {
Expand All @@ -297,6 +299,7 @@ class Build {
context.jobDsl targets: templatePath, ignoreExisting: false, additionalParameters: jobParams
}
}

context.catchError {
context.build job: jobName,
propagate: false,
Expand All @@ -309,6 +312,7 @@ class Build {
context.booleanParam(name: 'KEEP_REPORTDIR', value: buildConfig.KEEP_TEST_REPORTDIR),
context.string(name: 'ACTIVE_NODE_TIMEOUT', value: "${buildConfig.ACTIVE_NODE_TIMEOUT}"),
context.booleanParam(name: 'DYNAMIC_COMPILE', value: true),
context.string(name: 'VENDOR_TEST_BRANCHES', value: vendorTestBranches),
context.string(name: 'TIME_LIMIT', value: '1')
]
}
Expand Down

0 comments on commit 76febe0

Please sign in to comment.