diff --git a/vars/skipStage.groovy b/vars/skipStage.groovy index 17ec7d388..381be5d0f 100644 --- a/vars/skipStage.groovy +++ b/vars/skipStage.groovy @@ -158,7 +158,8 @@ boolean call(Map config = [:]) { } String target_branch = env.CHANGE_TARGET ? env.CHANGE_TARGET : env.BRANCH_NAME - String tags = config['tags'] ?: parseStageInfo()['test_tag'] + Map stageInfo = parseStageInfo() + String tags = config['tags'] ?: stageInfo['test_tag'] switch (env.STAGE_NAME) { case 'Cancel Previous Builds': @@ -353,6 +354,7 @@ boolean call(Map config = [:]) { case 'NLT on EL 8': case 'NLT on EL 8.8': return skip_stage_pragma('nlt') || + skip_build_on_el_gcc(target_branch, stageInfo['target'].replaceFirst('^el(\\d+).*', '$1')) || quickBuild() || stageAlreadyPassed() case 'Unit Test Bullseye': @@ -440,10 +442,8 @@ boolean call(Map config = [:]) { return skip_stage_pragma('fault-injection-test') || !paramsValue('CI_FI_TEST', true) || !paramsValue('CI_FI_el8_TEST', true) || /* release/2.6 Jenkinsfile still uses CI_FI_el8_TEST */ - quickFunctional() || - docOnlyChange(target_branch) || + skip_build_on_el_gcc(target_branch, stageInfo['target'].replaceFirst('^el(\\d+).*', '$1')) || skip_stage_pragma('func-test') || - skip_stage_pragma('func-test-vm') || stageAlreadyPassed() case 'Test CentOS 7 RPMs': return !paramsValue('CI_RPMS_el7_TEST', true) || diff --git a/vars/unitTest.groovy b/vars/unitTest.groovy index 8d10191c4..1733c0099 100755 --- a/vars/unitTest.groovy +++ b/vars/unitTest.groovy @@ -72,7 +72,28 @@ * * config['unstash_tests'] Un-stash -tests, default is true. * - * config['image_version'] Image version to use for provisioning, e.g. el8.8, leap15.6, etc. + * config['image_version'] Image version to use for provisioning, + * e.g. el8.8, leap15.6, etc. + * + * config['prov_env_vars'] Optional provisioning environment to use. + * Default ''. + * Formatted as 'KEY=VALUE' space-separated pairs + * and passed to the provisionNodesSystem call. + * + * config['testResults'] Junit test result files. + * Default 'test_results/*.xml' + * + * config['with_valgrind'] Valgrind tools name (e.g. memcheck). + * Default is '' (no Valgrind). + * + * config['always_script'] Script to run for cleanup and artifact collection + * Default is 'ci/unit/test_post_always.sh'. This + * script will be run even if the test script fails + * to allow for artifact collection and cleanup. + * + * config['valgrind_pattern'] Pattern for Valgrind files. + * Default: 'unit-test-*.memcheck.xml' + * */ Map afterTest(Map config, Map testRunInfo) { @@ -94,7 +115,7 @@ Map afterTest(Map config, Map testRunInfo) { } else { result['result'] = checkJunitFiles(testResults: testResults) } - if (config['with_valgrind'] || config['NLT']) { + if (config['with_valgrind']) { vgrcs = sh label: 'Check for Valgrind errors', script: "grep -E ')' ${valgrind_pattern} || true", returnStdout: true @@ -146,7 +167,8 @@ Map call(Map config = [:]) { node_count: stage_info['node_count'], distro: image_version, inst_repos: config.get('inst_repos', ''), - inst_rpms: inst_rpms) + inst_rpms: inst_rpms, + prov_env_vars: config.get('prov_env_vars', '')) /* el9-gcc-tests */ String target_stash = (image_version ?: ${stage_info['target']}).split('\\.')[0] @@ -180,7 +202,8 @@ Map call(Map config = [:]) { outputFile: 'bullseye.tar' } - String with_valgrind = stage_info.get('with_valgrind', '') + 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} " + @@ -202,13 +225,16 @@ Map call(Map config = [:]) { runTestData = runTest p runTestData.each { resultKey, data -> runData[resultKey] = data } } - p['always_script'] = stage_info.get('always_script', - 'ci/unit/test_post_always.sh') - p['valgrind_pattern'] = stage_info.get('valgrind_pattern', - 'unit-test-*memcheck.xml') - p['testResults'] = stage_info.get('testResults', 'test_results/*.xml') + 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 - p['NLT'] = stage_info['NLT'] runTestData = afterTest(p, runData) runTestData.each { resultKey, data -> runData[resultKey] = data } diff --git a/vars/unitTestPost.groovy b/vars/unitTestPost.groovy index aa081e008..16d4a8a34 100755 --- a/vars/unitTestPost.groovy +++ b/vars/unitTestPost.groovy @@ -17,23 +17,28 @@ * Default 'test_results/*.xml' * * config['valgrind_pattern'] Pattern for Valgrind files. - * Default: '*.memcheck.xml' + * Default: 'unit-test-*.memcheck.xml' * * config['valgrind_stash'] Name to stash Valgrind artifacts * Required if more than one stage is * creating Valgrind reports. + * + * config['NLT'] Set to true for NLT. + * + * config['FI'] Set to true for Fault Injection testing. + * FI also set NLT to true. + * */ - -// groovylint-disable DuplicateStringLiteral, VariableName /* groovylint-disable-next-line MethodSize */ void call(Map config = [:]) { Map stage_info = parseStageInfo(config) String cbcResult = currentBuild.currentResult // Stash the Valgrind files for later analysis - String valgrind_pattern = stage_info.get('valgrind_pattern', - 'unit-test-*memcheck.xml') if (config['valgrind_stash']) { + String valgrind_pattern = config.get('valgrind_pattern', + stage_info.get('valgrind_pattern', + 'unit-test-*memcheck.xml')) try { stash name: config['valgrind_stash'], includes: valgrind_pattern } catch (hudson.AbortException e) { @@ -56,7 +61,9 @@ void call(Map config = [:]) { List artifact_list = config.get('artifacts', ['run_test.sh/*']) - String testResults = stage_info.get('testResults', 'test_results/*.xml') + 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 @@ -66,7 +73,7 @@ void call(Map config = [:]) { junit testResults: testResults, healthScaleFactor: health_scale } - if (stage_info['with_valgrind'] || stage_info['NLT']) { + if (config.get('with_valgrind', stage_info.get('with_valgrind', false))) { String suite = sanitizedStageName() int vgfail = 0 String testdata @@ -106,12 +113,22 @@ void call(Map config = [:]) { return } - if (stage_info['NLT']) { + Boolean fi = config.get('FI', false) + Boolean nlt = fi || config.get('NLT',stage_info.get('NLT', false)) + if (nlt) { String cb_result = currentBuild.result discoverGitReferenceBuild(referenceJob: config.get('referenceJobName', 'daos-stack/daos/master'), scm: 'daos-stack/daos', requiredResult: 'UNSTABLE') + List nltTools = [issues(pattern: 'vm_test/nlt-errors.json', + name: fi ? 'Fault injection' : 'NLT errors', + id: sanitizedStageName() + '_VM_test')] + if (fi) { + nltTools << issues(pattern: 'nlt-client-leaks.json', + name: 'Fault injection leaks', + id: 'NLT_client') + } recordIssues enabledForFailure: true, /* ignore warning/errors from PMDK logging system */ filters: [excludeFile('pmdk/.+')], @@ -125,10 +142,8 @@ void call(Map config = [:]) { [threshold: 1, type: 'TOTAL_HIGH'], [threshold: 1, type: 'NEW_NORMAL', unstable: true], [threshold: 1, type: 'NEW_LOW', unstable: true]], - name: 'Node local testing', - tool: issues(pattern: 'vm_test/nlt-errors.json', - name: 'NLT results', - id: 'VM_test'), + name: fi?'Fault injection testing':'NLT', + tools: nltTools, scm: 'daos-stack/daos' if (cb_result != currentBuild.result) {