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
20 changes: 11 additions & 9 deletions vars/functionalTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,20 @@ Map call(Map config = [:]) {
inst_repos: config.get('inst_repos', ''),
inst_rpms: stage_inst_rpms)

List stashes = []
if (config['stashes']) {
stashes = config['stashes']
} else {
String target_compiler = "${stage_info['target']}-${stage_info['compiler']}"
stashes.add("${target_compiler}-install")
stashes.add("${target_compiler}-build-vars")
String test_rpms = config.get('test_rpms', env.TEST_RPMS)
if (test_rpms == 'false') {
if (config['stashes'] == null) {
config['stashes'] = []
}
if (config['stashes'].isEmpty()) {
config['stashes'].add("${stage_info['target']}-${stage_info['compiler']}-install")
config['stashes'].add("${stage_info['target']}-${stage_info['compiler']}-build-vars")
}
}

Map run_test_config = [:]
run_test_config['stashes'] = stashes
run_test_config['test_rpms'] = config.get('test_rpms', env.TEST_RPMS)
run_test_config['stashes'] = config.get('stashes', [])
run_test_config['test_rpms'] = test_rpms
run_test_config['pragma_suffix'] = stage_info['pragma_suffix']
run_test_config['test_tag'] = config.get('test_tag', stage_info['test_tag'])
run_test_config['node_count'] = stage_info['node_count']
Expand Down
7 changes: 6 additions & 1 deletion vars/getFunctionalTestStage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
* base_branch if specified, checkout sources from this branch before running tests
* 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
* stashes list of stashes to apply before running the stage
* job_status Map of status for each stage in the job/build
* @return a scripted stage to run in a pipeline
*/
Expand All @@ -41,6 +42,7 @@ 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)
List stashes = kwargs.get('stashes', [])
Map job_status = kwargs.get('job_status', [:])

return {
Expand Down Expand Up @@ -89,7 +91,10 @@ Map call(Map kwargs = [:]) {
nvme: nvme,
default_nvme: default_nvme,
provider: provider)['ftest_arg'],
test_function: 'runTestFunctionalV2'))
test_function: 'runTestFunctionalV2',
stashes: stashes
)
)
} finally {
println("[${name}] Running functionalTestPostV2()")
functionalTestPostV2()
Expand Down
16 changes: 14 additions & 2 deletions vars/runTestFunctionalV2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ Map call(Map config = [:]) {
}

if (test_rpms && config['stashes']) {
// we don't need (and might not even have) stashes if testing
// from RPMs
config['stashes'].each { name ->
try {
unstash name
} catch (hudson.AbortException ex) {
println("Unstash failed: ${ex}")
}
}
config.remove('stashes')
}

Expand Down Expand Up @@ -97,5 +102,12 @@ Map call(Map config = [:]) {
String name = 'func' + stage_info['pragma_suffix'] + '-cov'
stash name: config.get('coverage_stash', name),
includes: coverageFile

// 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
}