Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 63 additions & 42 deletions vars/getFunctionalTestStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
* rpmDistValue(distro)
* base_branch if specified, checkout sources from this branch before running tests
* other_packages space-separated string of additional RPM packages to install
* runStage whether or not to run the stage; overrides skipFunctionalTestStage()
* run_if_pr whether or not the stage should run for PR builds
* run_if_landing whether or not the stage should run for landing builds
* job_status Map of status for each stage in the job/build
Expand All @@ -47,6 +48,14 @@ Map call(Map kwargs = [:]) {
String other_packages = kwargs.get('other_packages', '')
Boolean run_if_pr = kwargs.get('run_if_pr', false)
Boolean run_if_landing = kwargs.get('run_if_landing', false)

// Temporarily use a String to allow determing if the value was unset, but when used pass the
// value in as a Boolean. This allows stages that have not yet been converted to use runStage
// to be skipped by the existing skipFunctionalTestStage logic, while new stages can use
// runStage directly. Once all stages have been converted to use runStage, this should be
// changed to a Boolean.
String runStage = kwargs.get('runStage', 'undefined').toString()

Map job_status = kwargs.get('job_status', [:])

return {
Expand All @@ -57,57 +66,69 @@ Map call(Map kwargs = [:]) {
String tags = getFunctionalTags(
pragma_suffix: pragma_suffix, stage_tags: stage_tags, default_tags: default_tags)

Map skip_kwargs = [
if (runStage == 'false') {
println("[${name}] Stage skipped by runStage=false")
Utils.markStageSkippedForConditional("${name}")
return
} else if (runStage == 'undefined') {
// To be removed once all stages have been converted to use runStage.
Map skip_kwargs = [
'tags': tags,
'pragma_suffix': pragma_suffix,
'distro': distro,
'run_if_pr': run_if_pr,
'run_if_landing': run_if_landing]
if (skipFunctionalTestStage(skip_kwargs)) {
println("[${name}] Stage skipped by skipFunctionalTestStage()")
if (skipFunctionalTestStage(skip_kwargs)) {
println("[${name}] Stage skipped by skipFunctionalTestStage()")
Utils.markStageSkippedForConditional("${name}")
return
}
} else if (!testsInStage(tags)) {
println("[${name}] Stage skipped by no tests matching the '${tags}' tags")
Utils.markStageSkippedForConditional("${name}")
} else {
node(cachedCommitPragma("Test-label${pragma_suffix}", label)) {
// Ensure access to any branch provisioning scripts exist
println("[${name}] Check out '${base_branch}' from version control")
if (base_branch) {
checkoutScm(
url: 'https://github.com/daos-stack/daos.git',
branch: base_branch,
withSubmodules: false,
pruneStaleBranch: true)
} else {
checkoutScm(pruneStaleBranch: true)
}
return
}

node(cachedCommitPragma("Test-label${pragma_suffix}", label)) {
// Ensure access to any branch provisioning scripts exist
println("[${name}] Check out '${base_branch}' from version control")
if (base_branch) {
checkoutScm(
url: 'https://github.com/daos-stack/daos.git',
branch: base_branch,
withSubmodules: false,
pruneStaleBranch: true)
} else {
checkoutScm(pruneStaleBranch: true)
}

try {
println("[${name}] Running functionalTest() on ${label} with tags=${tags}")
jobStatusUpdate(
job_status,
name,
functionalTest(
image_version: image_version,
inst_repos: daosRepos(distro),
inst_rpms: functionalPackages(
clientVersion: 1,
nextVersion: next_version,
addDaosPkgs: 'tests-internal',
rpmDistribution: rpm_distro) + ' ' + other_packages,
test_tag: tags,
ftest_arg: getFunctionalArgs(
pragma_suffix: pragma_suffix,
nvme: nvme,
default_nvme: default_nvme,
provider: provider)['ftest_arg'],
test_function: 'runTestFunctionalV2'))
} finally {
println("[${name}] Running functionalTestPostV2()")
functionalTestPostV2()
jobStatusUpdate(job_status, name)
}
try {
println("[${name}] Running functionalTest() on ${label} with tags=${tags}")
jobStatusUpdate(
job_status,
name,
functionalTest(
image_version: image_version,
inst_repos: daosRepos(distro),
inst_rpms: functionalPackages(
clientVersion: 1,
nextVersion: next_version,
addDaosPkgs: 'tests-internal',
rpmDistribution: rpm_distro) + ' ' + other_packages,
test_tag: tags,
ftest_arg: getFunctionalArgs(
pragma_suffix: pragma_suffix,
nvme: nvme,
default_nvme: default_nvme,
provider: provider)['ftest_arg'],
test_function: 'runTestFunctionalV2'))
} finally {
println("[${name}] Running functionalTestPostV2()")
functionalTestPostV2()
jobStatusUpdate(job_status, name)
}
}
println("[${name}] Finished with ${job_status}")
}
println("[${name}] Finished with ${job_status}")
}
}
10 changes: 1 addition & 9 deletions vars/unitPackages.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,8 @@ String call(Map config = [:]) {
Map stage_info = parseStageInfo(config)
String target = stage_info['target']

boolean quick_build = quickBuild()

if (target.startsWith('centos') || target.startsWith('el')) {
if (quick_build) {
// the script run below will read from this file
unstash target + '-required-mercury-rpm-version'
}

return sh(script: "${script} ${target} " +
String.valueOf(quick_build),
return sh(script: "${script} ${target}",
returnStdout: true)
}
error 'unitPackages not implemented for ' + target
Expand Down