diff --git a/Jenkinsfile b/Jenkinsfile index 9c4f411f8..dc6ff88b0 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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. * @@ -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 @@ -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 @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -386,7 +391,7 @@ pipeline { // skipStage(commit_msg: cm)) assert(skipStage(commit_msg: cm) == commit.skips[i]) i++ - } + } } cachedCommitPragma(clear: true) } @@ -448,7 +453,7 @@ pipeline { // assert() is pretty lame // println('assert(' + parseStageInfo()['test_tag'] + " == ${cmp})") assert(parseStageInfo()['test_tag'] == cmp) - } + } } } } @@ -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), diff --git a/vars/daosPackagesVersion.groovy b/vars/daosPackagesVersion.groovy index a951dc7f1..bc09ba33a 100644 --- a/vars/daosPackagesVersion.groovy +++ b/vars/daosPackagesVersion.groovy @@ -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 diff --git a/vars/daosRepos.groovy b/vars/daosRepos.groovy index 147e1388f..5375ee2d4 100644 --- a/vars/daosRepos.groovy +++ b/vars/daosRepos.groovy @@ -12,7 +12,6 @@ */ String daos_repo() { - String target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME if (target_branch.matches(testBranchRE())) { @@ -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() } diff --git a/vars/getDAOSPackages.groovy b/vars/getDAOSPackages.groovy index ca2f6c07b..b93fd5e38 100644 --- a/vars/getDAOSPackages.groovy +++ b/vars/getDAOSPackages.groovy @@ -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 } diff --git a/vars/skipStage.groovy b/vars/skipStage.groovy index 5fb3c82db..2e34e7417 100644 --- a/vars/skipStage.groovy +++ b/vars/skipStage.groovy @@ -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') || @@ -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']) { @@ -236,19 +238,19 @@ 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': @@ -256,14 +258,14 @@ boolean call(Map config = [:]) { 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': @@ -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':