Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start to deprecate the $distro + '-rpm-version... #359

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
37 changes: 21 additions & 16 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env groovy
/* groovylint-disable DuplicateListLiteral, DuplicateNumberLiteral, DuplicateStringLiteral, NestedBlockDepth */
/* groovylint-disable VariableName */
/* Copyright (C) 2019-2022 Intel Corporation
* All rights reserved.
*
Expand Down Expand Up @@ -46,11 +47,13 @@ void job_status_update(String name=env.STAGE_NAME,
String key = name.replace(' ', '_')
key = key.replaceAll('[ .]', '_')
if (job_status_internal.containsKey(key)) {
// groovylint-disable-next-line NoDef
/* groovylint-disable-next-line NoDef, VariableTypeRequired */
def myStage = job_status_internal[key]
/* groovylint-disable-next-line Instanceof */
if (myStage instanceof Map) {
/* groovylint-disable-next-line Instanceof */
if (value instanceof Map) {
value.each{ resultKey, data -> myStage[resultKey] = data }
value.each { resultKey, data -> myStage[resultKey] = data }
return
}
// Update result with single value
Expand All @@ -60,14 +63,16 @@ void job_status_update(String name=env.STAGE_NAME,
}
// pass through value
job_status_internal[key] = value
}
}

// groovylint-disable-next-line MethodParameterTypeRequired, NoDef
void job_step_update(def value) {
if (value == null) {
value = currentBuild.currentResult
/* groovylint-disable-next-line NoDef, VariableTypeRequired */
def _value = value
if (_value == null) {
_value = currentBuild.currentResult
}
job_status_update(env.STAGE_NAME, value)
job_status_update(env.STAGE_NAME, _value)
}

// Don't define this as a type or it loses it's global scope
Expand Down Expand Up @@ -126,7 +131,7 @@ pipeline {
junit_files: '*.xml non-exist*.xml',
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} // stage('grep JUnit results tests failure case')
stage('grep JUnit results tests error case 1') {
agent {
Expand All @@ -144,7 +149,7 @@ pipeline {
junit_files: '*.xml non-exist*.xml',
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} // stage('grep JUnit results tests error case 1')
stage('grep JUnit results tests error case 2') {
agent {
Expand All @@ -162,7 +167,7 @@ pipeline {
junit_files: '*.xml non-exist*.xml',
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} // stage('grep JUnit results tests error case 2')
stage('publishToRepository RPM tests') {
when {
Expand Down Expand Up @@ -267,7 +272,7 @@ pipeline {
junit_files: null,
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} //stage('provisionNodes with release/0.9 Repo')
stage('provisionNodes with master Repo') {
when {
Expand All @@ -293,7 +298,7 @@ pipeline {
junit_files: null,
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} // stage('provisionNodes with master Repo')
stage('provisionNodes with slurm EL8') {
when {
Expand Down Expand Up @@ -321,7 +326,7 @@ pipeline {
junit_files: null,
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} //stage('provisionNodes with slurm EL8')
stage('provisionNodes with slurm Leap15') {
when {
Expand All @@ -347,7 +352,7 @@ pipeline {
junit_files: null,
failure_artifacts: env.STAGE_NAME))
}
// runTest handles SCM notification via stepResult
// runTest handles SCM notification via stepResult
} //stage('provisionNodes_with_slurm_leap15')
stage('Commit Pragma tests') {
steps {
Expand Down Expand Up @@ -386,7 +391,7 @@ pipeline {
// skipStage(commit_msg: cm))
assert(skipStage(commit_msg: cm) == commit.skips[i])
i++
}
}
}
cachedCommitPragma(clear: true)
}
Expand Down Expand Up @@ -448,7 +453,7 @@ pipeline {
// assert() is pretty lame
// println('assert(' + parseStageInfo()['test_tag'] + " == ${cmp})")
assert(parseStageInfo()['test_tag'] == cmp)
}
}
}
}
}
Expand Down Expand Up @@ -549,7 +554,7 @@ pipeline {
parameters: [string(name: 'TestTag',
value: 'load_mpi test_core_files test_pool_info_query'),
string(name: 'CI_RPM_TEST_VERSION',
value: cachedCommitPragma('Test-skip-build', 'true') == 'true' ?
value: cachedCommitPragma('Test-skip-build', 'false') == 'true' ?
daosLatestVersion(env.TEST_BRANCH) : ''),
booleanParam(name: 'CI_UNIT_TEST', value: false),
booleanParam(name: 'CI_FI_el8_TEST', value: true),
Expand Down
9 changes: 6 additions & 3 deletions vars/daosPackagesVersion.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ String call(String distro, String next_version) {

// otherwise use the version in the stash
// but trim off any point release from the distro first
Integer dot = _distro.indexOf('.')
if (dot > -1) {
_distro = _distro[0..dot - 1]
// for non ubuntu distros
if (!_distro.startsWith('ubuntu')) {
Integer dot = _distro.indexOf('.')
if (dot > -1) {
_distro = _distro[0..dot - 1]
}
}

String err_msg = null
Expand Down
4 changes: 1 addition & 3 deletions vars/daosRepos.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*/

String daos_repo() {

String target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME

if (target_branch.matches(testBranchRE())) {
Expand All @@ -32,10 +31,9 @@ String call() {
}

String call(String distro) {

String pr_repos = prRepos(distro)

if (!pr_repos.contains('daos@')) {
if (!pr_repos.split().any { i -> i.startsWith('daos@') }) {
pr_repos += ' ' + daos_repo()
}

Expand Down
13 changes: 5 additions & 8 deletions vars/getDAOSPackages.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@ String call(String distro, String next_version, String add_daos_pkgs) {

String pkgs
if (env.TEST_RPMS == 'true') {
pkgs = 'daos{,-{client,tests,server,serialize}' + _add_daos_pkgs + '}'
pkgs = 'daos{,-{client,tests,server}' + _add_daos_pkgs + '}'
} else {
pkgs = 'daos{,-client}'
}

String version = daosPackagesVersion(distro, next_version)
if (!distro.startsWith('ubuntu')) {
String version = daosPackagesVersion(distro, next_version)

if (version != '') {
if (distro.startsWith('ubuntu20')) {
pkgs += '='
} else {
pkgs += '-'
if (version != '') {
pkgs += '-' + version
}
pkgs += daosPackagesVersion(distro, next_version)
}
return pkgs
}
18 changes: 9 additions & 9 deletions vars/skipStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ boolean skip_ftest(String distro, String target_branch) {
// The params.CI_MORE_FUNCTIONAL_PR_TESTS allows enabling
// tests that are not run in PRs.
return !paramsValue('CI_FUNCTIONAL_' + distro + '_TEST', true) ||
distro == 'ubuntu20' ||
skip_stage_pragma('func-test') ||
skip_stage_pragma('func-test-vm') ||
skip_stage_pragma('func-test-vm-all') ||
Expand Down Expand Up @@ -202,6 +201,9 @@ boolean skip_build_bullseye(String target_branch, String distro) {
quickFunctional()
}

boolean pr_repos_contains(String distro, String value) {
return prRepos(distro).split().any { i -> i.startsWith(value + '@') }
}
/* groovylint-disable-next-line MethodSize */
boolean call(Map config = [:]) {
if (config['stage']) {
Expand Down Expand Up @@ -236,34 +238,34 @@ boolean call(Map config = [:]) {
skip_stage_pragma('build') ||
rpmTestVersion() != '' ||
(quickFunctional() &&
cachedCommitPragma('PR-repos').trim().contains('daos@'))
cachedCommitPragma('PR-repos').split().any { -> it it.startsWith('daos@') })
case 'Build RPM on CentOS 7':
return paramsValue('CI_RPM_centos7_NOBUILD', false) ||
(docOnlyChange(target_branch) &&
prRepos('centos7') == '') ||
prRepos('centos7').contains('daos@') ||
pr_repos_contains('centos7', 'daos') ||
skip_stage_pragma('build-centos7-rpm')
case 'Build RPM on EL 8':
case 'Build RPM on CentOS 8':
return paramsValue('CI_RPM_el8_NOBUILD', false) ||
(docOnlyChange(target_branch) &&
prRepos('el8') == '') ||
prRepos('el8').contains('daos@') ||
pr_repos_contains('el8', 'daos') ||
skip_stage_pragma('build-el8-rpm')
case 'Build RPM on Leap 15':
case 'Build RPM on Leap 15.4':
return paramsValue('CI_RPM_leap15_NOBUILD', false) ||
target_branch == 'weekly-testing' ||
(docOnlyChange(target_branch) &&
prRepos('leap15') == '') ||
prRepos('leap15').contains('daos@') ||
pr_repos_contains('leap15', 'daos') ||
skip_stage_pragma('build-leap15-rpm')
case 'Build DEB on Ubuntu 20.04':
return paramsValue('CI_RPM_ubuntu20_NOBUILD', false) ||
target_branch == 'weekly-testing' ||
(docOnlyChange(target_branch) &&
prRepos('ubuntu20') == '') ||
prRepos('ubuntu20').contains('daos@') ||
pr_repos_contains('ubuntu20', 'daos') ||
skip_stage_pragma('build-ubuntu20-rpm')
case 'Build on CentOS 8':
case 'Build on EL 8':
Expand Down Expand Up @@ -437,9 +439,7 @@ boolean call(Map config = [:]) {
case 'Functional on Leap 15.4':
return skip_ftest('leap15', target_branch)
case 'Functional on Ubuntu 20.04':
/* we don't do any testing on Ubuntu yet
skip_ftest('ubuntu20', target_branch) */
return true
return skip_ftest('ubuntu20', target_branch)
case 'Fault injection testing':
case 'Fault injection testing on CentOS 8':
case 'Fault injection testing on EL 8':
Expand Down