diff --git a/vars/buildRpmPost.groovy b/vars/buildRpmPost.groovy index b2b1f45a3..bee323adf 100755 --- a/vars/buildRpmPost.groovy +++ b/vars/buildRpmPost.groovy @@ -49,13 +49,19 @@ * * config['rpmlint'] Whether to run rpmlint on resulting RPMs. * Default false. + * * config['new_rpm'] Whether we are using new RPM or not - * Default false + * Default false. + * Deprecated, use config['productArtifacts'] instead. + * + * config['productArtifacts'] List of product names and artifact directories to publish. + * Default is to publish the whole target directory. * * config['unsuccessful_script'] Script to run if build is not successful. * Default 'ci/rpm/build_unsuccessful.sh' */ +/* groovylint-disable-next-line MethodSize */ void call(Map config = [:]) { Map stage_info = parseStageInfo(config) @@ -89,24 +95,37 @@ void call(Map config = [:]) { includes: rpm_version_file } + List productNames = config.get('productArtifacts', []) + // Backwards compatibility for new_rpm parameter. + if (!productNames && config.get('new_rpm', false)) { + productNames = ['daos', 'deps'] + } + String product = config.get('product', 'daos-stack') - String artdir = 'artifacts/' + target - if (config.get('new_rpm', false)) { - String deps_dir = 'artifacts/' + target + '/deps' - if (fileExists(deps_dir)) { - publishToRepository product: 'deps', + Map productArtifacts = [:] + for (String name : productNames) { + if (name == 'daos') { + // Use the product name for daos + productArtifacts[product] = "artifacts/${target}/${name}" + } else { + // Use the specified name or other products, e.g. deps + productArtifacts[name] = "artifacts/${target}/${name}" + } + } + if (!productArtifacts) { + // Publish the whole target directory if no productArtifacts are specified + productArtifacts[product] = "artifacts/${target}" + } + for (String key in productArtifacts.keySet()) { + String artifactDir = productArtifacts[key] + if (fileExists(artifactDir)) { + publishToRepository product: key, format: repo_format, maturity: 'stable', tech: target, - repo_dir: deps_dir + repo_dir: artifactDir } - artdir = 'artifacts/' + target + '/daos' } - publishToRepository product: product, - format: repo_format, - maturity: 'stable', - tech: target, - repo_dir: artdir if (config.get('rpmlint', false)) { rpmlintMockResults(sh(label: 'Get chroot name', diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 2d9520200..cc3482a12 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -59,6 +59,12 @@ * * config['ftest_arg'] Functional test launch.py arguments. * Default determined by parseStageInfo(). + * + * config['coverage_stash'] Name to stash coverage artifacts. + * Default is empty string, which will result in no stashing. + * + * config['bullseye'] Set to true to use bullseye-sepecific repo. + * Default false. */ Map call(Map config = [:]) { @@ -66,6 +72,8 @@ Map call(Map config = [:]) { String nodelist = config.get('NODELIST', env.NODELIST) String context = config.get('context', 'test/' + env.STAGE_NAME) String description = config.get('description', env.STAGE_NAME) + String coverage_stash = config.get('coverage_stash', '') + Boolean bullseye = config.get('bullseye', false) Map stage_info = parseStageInfo(config) @@ -93,7 +101,8 @@ Map call(Map config = [:]) { node_count: stage_info['node_count'], distro: image_version, inst_repos: config.get('inst_repos', ''), - inst_rpms: stage_inst_rpms) + inst_rpms: stage_inst_rpms, + bullseye: bullseye) List stashes = [] if (config['stashes']) { @@ -113,6 +122,7 @@ Map call(Map config = [:]) { run_test_config['ftest_arg'] = config.get('ftest_arg', stage_info['ftest_arg']) run_test_config['context'] = context run_test_config['description'] = description + run_test_config['coverage_stash'] = coverage_stash Map runtestData = [:] if (config.get('test_function', 'runTestFunctional') == diff --git a/vars/getFunctionalTestStage.groovy b/vars/getFunctionalTestStage.groovy index 406cc0bbe..42781b787 100644 --- a/vars/getFunctionalTestStage.groovy +++ b/vars/getFunctionalTestStage.groovy @@ -24,15 +24,20 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils * '.el9', '.suse.lp156', etc. If not specified, it will be determined by * rpmDistValue(distro) * base_branch if specified, checkout sources from this branch before running tests + * inst_rpms space-separated string of RPM packages to install on the test nodes; + * exclusive of next_version, rpm_distro, and other_packages. * other_packages space-separated string of additional RPM packages to install + * bullseye whether or not to use the bullseye-sepecific repo for provisioning * node_count number of nodes to provision and use for the stage; overrides the count * that would otherwise be inferred from the stage name by parseStageInfo() * 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 + * coverage_stash name of stash to include code coverage results from the tests * @return a scripted stage to run in a pipeline */ +/* groovylint-disable-next-line MethodSize */ Map call(Map kwargs = [:]) { String name = kwargs.get('name', 'Unknown Functional Test Stage') String pragma_suffix = kwargs.get('pragma_suffix') @@ -47,7 +52,9 @@ Map call(Map kwargs = [:]) { String image_version = kwargs.get('image_version', null) String rpm_distro = kwargs.get('rpm_distro', null) String base_branch = kwargs.get('base_branch') + String inst_rpms = kwargs.get('inst_rpms', null) String other_packages = kwargs.get('other_packages', '') + Boolean bullseye = kwargs.get('bullseye', false) Integer node_count = kwargs.get('node_count') as Integer Boolean run_if_pr = kwargs.get('run_if_pr', false) Boolean run_if_landing = kwargs.get('run_if_landing', false) @@ -57,39 +64,49 @@ Map call(Map kwargs = [:]) { // 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() + final String UNDEFINED = 'undefined' + String runStage = kwargs.get('runStage', UNDEFINED) Map job_status = kwargs.get('job_status', [:]) + String coverage_stash = kwargs.get('coverage_stash', '') return { stage("${name}") { + /* groovylint-disable-next-line DuplicateStringLiteral */ + if (runStage == 'false') { + println("[${name}] Stage skipped by runStage=false") + Utils.markStageSkippedForConditional("${name}") + return + } + // Get the tags for the stage. Use either the build parameter, commit pragma, or // default tags. All tags are combined with the stage tags to ensure only tests that // 'fit' the cluster will be run. String tags = getFunctionalTags( pragma_suffix: pragma_suffix, stage_tags: stage_tags, default_tags: default_tags) + println("[${name}] Functional test stage tags: ${tags}") + if (runStage == 'true') { + println("[${name}] Checking if the tags match any tests to run in the stage") + if (!testsInStage(tags)) { + println("[${name}] Stage skipped by no tests matching the '${tags}' tags") + Utils.markStageSkippedForConditional("${name}") + return + } + } - 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. + // To be removed once all stages have been converted to use runStage. + if (runStage == UNDEFINED) { Map skip_kwargs = [ - 'tags': tags, - 'pragma_suffix': pragma_suffix, - 'distro': distro, - 'run_if_pr': run_if_pr, - 'run_if_landing': run_if_landing] + '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()") Utils.markStageSkippedForConditional("${name}") return } - } else if (!testsInStage(tags)) { - println("[${name}] Stage skipped by no tests matching the '${tags}' tags") - Utils.markStageSkippedForConditional("${name}") - return } node(cachedCommitPragma("Test-label${pragma_suffix}", label)) { @@ -110,7 +127,7 @@ Map call(Map kwargs = [:]) { Map ftestConfig = [ image_version: image_version, inst_repos: daosRepos(distro), - inst_rpms: functionalPackages( + inst_rpms: inst_rpms ?: functionalPackages( clientVersion: 1, nextVersion: next_version, addDaosPkgs: 'tests-internal', @@ -121,8 +138,11 @@ Map call(Map kwargs = [:]) { nvme: nvme, default_nvme: default_nvme, provider: provider)['ftest_arg'], - test_function: 'runTestFunctionalV2'] + test_function: 'runTestFunctionalV2', + bullseye: bullseye, + coverage_stash: coverage_stash] if (node_count != null) { + /* groovylint-disable-next-line DuplicateStringLiteral */ ftestConfig['node_count'] = node_count } jobStatusUpdate( diff --git a/vars/provisionNodes.groovy b/vars/provisionNodes.groovy index 0c74329c1..4030850c7 100644 --- a/vars/provisionNodes.groovy +++ b/vars/provisionNodes.groovy @@ -26,6 +26,8 @@ * config['timeout'] Timeout in minutes. Default 30. * config['inst_repos'] DAOS stack repos that should be configured. * config['inst_rpms'] DAOS stack RPMs that should be installed. + * config['bullseye'] Set to true to use bullseye-specific repo. Default false. + * * if timeout is <= 0, then will not wait for provisioning. * if power_only is specified, the nodes will be rebooted and the * provisioning information ignored. @@ -175,6 +177,7 @@ Map call(Map config = [:]) { // https://issues.jenkins.io/browse/JENKINS-55819 'CI_RPM_TEST_VERSION="' + (params.CI_RPM_TEST_VERSION ?: '') + '" ' + 'CI_PR_REPOS="' + (params.CI_PR_REPOS ?: '') + '" ' + + 'CI_BULLSEYE="' + (config.get('bullseye', false) ? 'true' : 'false') + '" ' + ((env.DAOS_HTTPS_PROXY ?: env.HTTPS_PROXY) ? 'HTTPS_PROXY="' + (env.DAOS_HTTPS_PROXY ?: env.HTTPS_PROXY) + '" ' : '') + 'ci/provisioning/post_provision_config.sh' diff --git a/vars/runTestFunctionalV2.groovy b/vars/runTestFunctionalV2.groovy index bf53e4b6e..6fde679b8 100644 --- a/vars/runTestFunctionalV2.groovy +++ b/vars/runTestFunctionalV2.groovy @@ -90,14 +90,18 @@ Map call(Map config = [:]) { // Restore the ignore failure setting config['ignore_failure'] = ignore_failure - String coverageFile = 'test.cov' - if (!fileExists('test.cov')) { - coverageFile += '_not_done' - fileOperations([fileCreateOperation(fileName: coverageFile, - fileContent: '')]) + // Stash code coverage file if it exists + String coverage_stash = config.get('coverage_stash', '') + if (coverage_stash) { + try { + stash name: coverage_stash, includes: '**/test.cov' + println("[${env.STAGE_NAME}] Stashed code coverage file in ${coverage_stash}") + } catch (hudson.AbortException e) { + println( + "[${env.STAGE_NAME}] Failed to stash code coverage file in ${coverage_stash}: " + + "${e.message}") + } } - String name = 'func' + stage_info['pragma_suffix'] + '-cov' - stash name: config.get('coverage_stash', name), - includes: coverageFile + return runData } diff --git a/vars/scriptedDockerStage.groovy b/vars/scriptedDockerStage.groovy new file mode 100644 index 000000000..91c6ea5a2 --- /dev/null +++ b/vars/scriptedDockerStage.groovy @@ -0,0 +1,132 @@ +/* groovylint-disable NestedBlockDepth */ +// vars/scriptedDockerStage.groovy + +import org.jenkinsci.plugins.pipeline.modeldefinition.Utils + +/** + * scriptedDockerStage + * + * Get a docker stage in scripted syntax. + * + * @param kwargs Map containing the following optional arguments (empty strings yield defaults): + * name the docker stage name + * runStage optional additional condition to determine if the stage runs + * jobStatus Map of status for each stage in the job/build + * dockerTag the docker image tag to use for the build + * dockerBuildArgs optional docker build arguments + * stepMethod method to call to run the stage + * stepMethodArgs arguments to pass to the stepMethod; defaults to [:] + * installScript optional script to run to install rpms; defaults to '' + * buildScript optional script to run to build dependencies; defaults to '' + * configLog optional config.log name to archive upon exception + * valgrindSconsBuildArgs optional scons build arguments for valgrind build + * generateRpmsScript optional script to run to generate rpms; defaults to '' + * buildRpmPostArgs optional arguments to pass to buildRpmPost(); defaults to [:] + * archiveArtifactsArgs optional arguments to pass to archiveArtifacts() + * @return a scripted stage to run in a pipeline + */ +/* groovylint-disable-next-line MethodSize */ +Map call(Map kwargs = [:]) { + String name = kwargs.get('name', 'Unknown Docker Stage') + Boolean runStage = kwargs.get('runStage', true) + Map jobStatus = kwargs.get('jobStatus', null) ?: [:] + String dockerTag = kwargs.get('dockerTag', 'unknown-docker-tag') + String dockerBuildArgs = kwargs.get('dockerBuildArgs', '') + Closure stepMethod = kwargs.get('stepMethod') + Map stepMethodArgs = kwargs.get('stepMethodArgs', null) ?: [:] + + // Optional scripts and arguments that drive the stage steps + String installScript = kwargs.get('installScript', '') + String buildScript = kwargs.get('buildScript', '') + String configLog = kwargs.get('configLog', '') + Map valgrindSconsBuildArgs = kwargs.get('valgrindSconsBuildArgs', null) ?: [:] + String generateRpmsScript = kwargs.get('generateRpmsScript', '') + Map buildRpmPostArgs = kwargs.get('buildRpmPostArgs', null) ?: [:] + Map archiveArtifactsArgs = kwargs.get('archiveArtifactsArgs', null) ?: [:] + + return { + stage("${name}") { + if (!runStage) { + println("[${name}] Marking docker stage as skipped") + Utils.markStageSkippedForConditional("${name}") + return + } + node('docker_runner') { + println("[${name}] Check out from version control") + checkoutScm(pruneStaleBranch: true) + + Throwable tryError = null + /* groovylint-disable-next-line NoDef, VariableTypeRequired */ + def dockerImage = docker.build(dockerTag, dockerBuildArgs) + try { + dockerImage.inside { + if (installScript) { + println("[${name}] Running installScript") + sh label: 'Install RPMs', + script: "${installScript}" + } + if (buildScript) { + println("[${name}] Running buildScript") + sh label: 'Build deps', + script: "${buildScript}" + } + println("[${name}] Running stepMethod: ${stepMethod?.getClass()?.name}") + jobStatusUpdate(jobStatus, name, stepMethod.call(stepMethodArgs)) + if (valgrindSconsBuildArgs) { + println("[${name}] Running valgrind build for NLT") + // For non-release builds, create a separate build with the valgrind + // tag for NLT memcheck testing. This is necessary to avoid problems + // caused by valgrind being confused by the Go runtime. We don't want + // to use the valgrind build for normal testing because it is much + // slower. BUILD_TYPE=dev is set for PR/dev builds in sconsArgs(), and + // TARGET_TYPE=release is used to select pre-built cached prerequisites. + jobStatusUpdate(jobStatus, name, sconsBuild(valgrindSconsBuildArgs)) + sh label: 'Stash valgrind install tree for NLT', + script: 'tar -C / -cf opt-daos-valgrind.tar opt/daos' + stash(name: 'opt-daos-valgrind', includes: 'opt-daos-valgrind.tar') + } + if (generateRpmsScript) { + println("[${name}] Running generateRpmsScript") + sh label: 'Generate RPMs', + script: "${generateRpmsScript}" + } + if (buildRpmPostArgs) { + println("[${name}] Running buildRpmPost()") + buildRpmPost(buildRpmPostArgs) + } + } + /* groovylint-disable-next-line CatchException */ + } catch (Exception e) { + tryError = e + println("[${name}] Caught exception in try: ${tryError}") + if (configLog) { + sh label: 'Archive config.log', + script: "if [ -f config.log ]; then mv config.log ${configLog}; fi" + archiveArtifacts artifacts: "${configLog}", allowEmptyArchive: true + } + jobStatusUpdate(jobStatus, name, 'FAILURE') + throw tryError + } finally { + // Cleanup actions + try { + if (archiveArtifactsArgs) { + println("[${name}] Running archiveArtifacts()") + archiveArtifacts(archiveArtifactsArgs) + } + jobStatusUpdate(jobStatus, name) + /* groovylint-disable-next-line CatchException */ + } catch (Exception finallyError) { + println("[${name}] Caught exception in finally: ${finallyError}") + /* groovylint-disable-next-line DuplicateStringLiteral */ + jobStatusUpdate(jobStatus, name, 'FAILURE') + if (tryError == null) { + /* groovylint-disable-next-line ThrowExceptionFromFinallyBlock */ + throw finallyError + } + } + } + } + println("[${name}] Finished with ${jobStatus}") + } + } +} diff --git a/vars/unitTest.groovy b/vars/unitTest.groovy index 1733c0099..69d01c997 100755 --- a/vars/unitTest.groovy +++ b/vars/unitTest.groovy @@ -150,32 +150,35 @@ Map call(Map config = [:]) { long startDate = System.currentTimeMillis() String nodelist = config.get('NODELIST', env.NODELIST) String test_script = config.get('test_script', 'ci/unit/test_main.sh') - Map stage_info = parseStageInfo(config) String inst_rpms = config.get('inst_rpms', '') - if (stage_info['compiler'] == 'covc') { - if (stage_info['java_pkg']) { - inst_rpms += " ${stage_info['java_pkg']}" - } - } + // Support backwards compatibility with parseStageInfo when config keys are ommitted + Map stage_info = parseStageInfo(config) + Integer node_count = config.get('node_count', stage_info['node_count']) + String target = config.get('target', stage_info['ci_target']) + String distro_version = config.get('distro_version', stage_info['distro_version']) + String compiler = config.get('compiler', stage_info['compiler']) + String build_type = config.get('build_type', stage_info['build_type']) + String with_valgrind = config.get('with_valgrind', stage_info.get('with_valgrind', '')) String image_version = config.get('image_version', '') ?: - (stage_info['ci_target'] =~ /([a-z]+)(.*)/)[0][1] + stage_info['distro_version'] + (target =~ /([a-z]+)(.*)/)[0][1] + distro_version Map runData = provisionNodes( - NODELIST: nodelist, - node_count: stage_info['node_count'], - distro: image_version, - inst_repos: config.get('inst_repos', ''), - inst_rpms: inst_rpms, - prov_env_vars: config.get('prov_env_vars', '')) + NODELIST: nodelist, + node_count: node_count, + distro: image_version, + inst_repos: config.get('inst_repos', ''), + inst_rpms: inst_rpms, + prov_env_vars: config.get('prov_env_vars', ''), + bullseye: compiler == 'covc') /* el9-gcc-tests */ - String target_stash = (image_version ?: ${stage_info['target']}).split('\\.')[0] + String target_stash = (image_version ?: target).split('\\.')[0] - target_stash += '-' + stage_info['compiler'] - if (stage_info['build_type']) { - target_stash += '-' + stage_info['build_type'] + target_stash += '-' + compiler + if (build_type) { + target_stash += '-' + build_type } List stashes = [] @@ -193,55 +196,52 @@ Map call(Map config = [:]) { } } - if (stage_info['compiler'] == 'covc') { - String tools_url = env.JENKINS_URL + - 'job/daos-stack/job/tools/job/master' + - '/lastSuccessfulBuild/artifact/' - httpRequest url: tools_url + 'bullseyecoverage-linux.tar', - httpMode: 'GET', - outputFile: 'bullseye.tar' - } - - String with_valgrind = config.get('with_valgrind', - stage_info.get('with_valgrind', '')) - Map p = [:] - p['stashes'] = stashes - p['script'] = "SSH_KEY_ARGS=${env.SSH_KEY_ARGS} " + - "NODELIST=${nodelist} " + - "WITH_VALGRIND=${with_valgrind} " + - test_script - p['junit_files'] = config.get('junit_files', 'test_results/*.xml') - p['context'] = config.get('context', 'test/' + env.STAGE_NAME) - p['description'] = config.get('description', env.STAGE_NAME) + Map params = [:] + params['stashes'] = stashes + params['script'] = "SSH_KEY_ARGS=${env.SSH_KEY_ARGS} " + + "NODELIST=${nodelist} " + + "WITH_VALGRIND=${with_valgrind} " + + test_script + params['junit_files'] = config.get('junit_files', 'test_results/*.xml') + params['context'] = config.get('context', 'test/' + env.STAGE_NAME) + params['description'] = config.get('description', env.STAGE_NAME) // Do not let runTest abort the pipeline as want artifact/log collection. - p['ignore_failure'] = true + params['ignore_failure'] = true // runTest no longer knows now to notify for Unit Tests - p['notify_result'] = false + params['notify_result'] = false int time = config.get('timeout_time', 120) as int String unit = config.get('timeout_unit', 'MINUTES') Map runTestData = [:] timeout(time: time, unit: unit) { - runTestData = runTest p + runTestData = runTest params runTestData.each { resultKey, data -> runData[resultKey] = data } } - p['always_script'] = config.get('always_script', - stage_info.get('always_script', - 'ci/unit/test_post_always.sh')) - p['valgrind_pattern'] = config.get('valgrind_pattern', - stage_info.get('valgrind_pattern', - 'unit-test-*memcheck.xml')) - p['testResults'] = config.get('testResults', - stage_info.get('testResults', - 'test_results/*.xml')) - p['with_valgrind'] = with_valgrind - runTestData = afterTest(p, runData) + params['always_script'] = config.get( + 'always_script', + stage_info.get('always_script', 'ci/unit/test_post_always.sh')) + params['valgrind_pattern'] = config.get( + 'valgrind_pattern', + stage_info.get('valgrind_pattern', 'unit-test-*memcheck.xml')) + params['testResults'] = config.get( + 'testResults', + stage_info.get('testResults', 'test_results/*.xml')) + if (compiler == 'covc') { + // Bullseye does not support Valgrind, so ignore the setting if compiler is covc + params['with_valgrind'] = '' + } else { + params['with_valgrind'] = with_valgrind + } + runTestData = afterTest(params, runData) runTestData.each { resultKey, data -> runData[resultKey] = data } - if (stage_info['compiler'] == 'covc') { + if (compiler == 'covc') { + // Stash the bullseye code coverage report if it was generated stash name: config.get('coverage_stash', "${target_stash}-unit-cov"), - includes: 'test.cov' + includes: '**/test.cov' + allowEmpty: true } + int runTime = durationSeconds(startDate) runData['unittest_time'] = runTime @@ -255,11 +255,5 @@ Map call(Map config = [:]) { stash name: results_map, includes: results_map - // Stash any optional test coverage reports for the stage - String code_coverage = 'code_coverage_' + sanitizedStageName() - stash name: code_coverage, - includes: '**/code_coverage.json', - allowEmpty: true - return runData } diff --git a/vars/unitTestPost.groovy b/vars/unitTestPost.groovy index 16d4a8a34..79439641b 100755 --- a/vars/unitTestPost.groovy +++ b/vars/unitTestPost.groovy @@ -1,4 +1,4 @@ -/* groovylint-disable DuplicateNumberLiteral */ +/* groovylint-disable DuplicateNumberLiteral, DuplicateStringLiteral, VariableName */ // vars/unitTestPost.groovy /** @@ -27,16 +27,23 @@ * * config['FI'] Set to true for Fault Injection testing. * FI also set NLT to true. - * */ /* groovylint-disable-next-line MethodSize */ void call(Map config = [:]) { Map stage_info = parseStageInfo(config) String cbcResult = currentBuild.currentResult + // Support backwards compatibility with parseStageInfo when config keys are ommitted + String target = config.get('target', stage_info['ci_target']) + String compiler = config.get('compiler', stage_info['compiler']) + String build_type = config.get('build_type', stage_info['build_type']) + String with_valgrind = config.get('with_valgrind', stage_info.get('with_valgrind', '')) + String testResults = config.get( + 'testResults', stage_info.get('testResults', 'test_results/*.xml')) + // Stash the Valgrind files for later analysis if (config['valgrind_stash']) { - String valgrind_pattern = config.get('valgrind_pattern', + String valgrind_pattern = config.get('valgrind_pattern', stage_info.get('valgrind_pattern', 'unit-test-*memcheck.xml')) try { @@ -61,9 +68,6 @@ void call(Map config = [:]) { List artifact_list = config.get('artifacts', ['run_test.sh/*']) - String testResults = config.get('testResults', - stage_info.get('testResults', - 'test_results/*.xml')) if (testResults != 'None' ) { // groovylint-disable-next-line NoDouble double health_scale = 1.0 @@ -73,7 +77,7 @@ void call(Map config = [:]) { junit testResults: testResults, healthScaleFactor: health_scale } - if (config.get('with_valgrind', stage_info.get('with_valgrind', false))) { + if (with_valgrind) { String suite = sanitizedStageName() int vgfail = 0 String testdata @@ -104,17 +108,17 @@ void call(Map config = [:]) { archiveArtifacts artifacts: artifactPat, allowEmptyArchive: results['ignore_failure'] } - String target_stash = "${stage_info['target']}-${stage_info['compiler']}" - if (stage_info['build_type']) { - target_stash += '-' + stage_info['build_type'] + String target_stash = "${target}-${compiler}" + if (build_type) { + target_stash += "-${build_type}" } // Coverage instrumented tests and Valgrind are probably mutually exclusive - if (stage_info['compiler'] == 'covc') { + if (compiler == 'covc') { return } Boolean fi = config.get('FI', false) - Boolean nlt = fi || config.get('NLT',stage_info.get('NLT', false)) + Boolean nlt = fi || config.get('NLT', stage_info.get('NLT', false)) if (nlt) { String cb_result = currentBuild.result discoverGitReferenceBuild(referenceJob: config.get('referenceJobName', @@ -142,7 +146,7 @@ void call(Map config = [:]) { [threshold: 1, type: 'TOTAL_HIGH'], [threshold: 1, type: 'NEW_NORMAL', unstable: true], [threshold: 1, type: 'NEW_LOW', unstable: true]], - name: fi?'Fault injection testing':'NLT', + name: fi ? 'Fault injection testing' : 'NLT', tools: nltTools, scm: 'daos-stack/daos'