Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
11 changes: 5 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ pipeline {
stages = ['Functional on Leap 15',
'Functional on CentOS 7',
'Functional on EL 8',
'Functional Hardware Small',
'Functional Hardware Medium',
'Functional Hardware Large']
commits = [[pragmas: ['Skip-func-test-leap15: false'],
Expand All @@ -301,7 +300,7 @@ pipeline {
[pragmas: [''],
/* groovylint-disable-next-line UnnecessaryGetter */
skips: [isPr(), isPr(), false, !isPr(), !isPr(), !isPr()]],
[pragmas: ['Skip-func-hw-test-small: true'],
[pragmas: ['Skip-func-hw-test-medium: true'],
/* groovylint-disable-next-line UnnecessaryGetter */
skips: [isPr(), isPr(), false, true, !isPr(), !isPr()]]]
commits.each { commit ->
Expand Down Expand Up @@ -336,11 +335,11 @@ pipeline {
// lots more test cases could be cooked up, to be sure
script {
stages = [[name: 'Fake CentOS 7 Functional stage',
tag: '-hw'],
[name: 'Fake CentOS 7 Functional Hardware Small stage',
tag: 'hw,small'],
tag: '-hw',],
[name: 'Fake CentOS 7 Functional Hardware Medium stage',
tag: 'hw,medium'],
tag: 'hw,medium,-provider'],
[name: 'Fake CentOS 7 Functional Hardware Medium Provider stage',
tag: 'hw,medium,provider'],
[name: 'Fake CentOS 7 Functional Hardware Large stage',
tag: 'hw,large']]
commits = [[tags: [[tag: 'Test-tag', value: 'datamover']],
Expand Down
39 changes: 16 additions & 23 deletions vars/parseStageInfo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ String get_commit_pragma_tags(String pragma_suffix) {
return pragma_tag
}

String get_param_or_pragma(param, pragma, arg, predefined) {
String res = params.$param ?: cachedCommitPragma(
pragma + result['pragma_suffix'], cachedCommitPragma(pragma, predefined))

return res ? ' ' + arg + '= ' + res : ''
}

/* groovylint-disable-next-line MethodSize */
void call(Map config = [:]) {
Expand Down Expand Up @@ -206,7 +212,6 @@ void call(Map config = [:]) {

String cluster_size = ''
String ftest_arg_nvme = ''
String ftest_arg_repeat = ''
String ftest_arg_provider = ''
if (stage_name.contains('Functional')) {
result['test'] = 'Functional'
Expand Down Expand Up @@ -285,32 +290,20 @@ void call(Map config = [:]) {
tag = tag.trim()
}

// Get the ftest --nvme argument from either the build parameters or commit pragmas
ftest_arg_nvme = params.TestNvme ?: cachedCommitPragma(
'Test-nvme' + result['pragma_suffix'], cachedCommitPragma('Test-nvme', ftest_arg_nvme))

// Get the ftest --repeat argument from either the build parameters or commit pragmas
ftest_arg_repeat = params.TestRepeat ?: cachedCommitPragma(
'Test-repeat' + result['pragma_suffix'], cachedCommitPragma('Test-repeat', null))

// Get the ftest --provider argument from either the build parameters or commit pragmas if not
// already defined by the stage
if (!ftest_arg_provider) {
ftest_arg_provider = params.TestProvider ?: cachedCommitPragma(
'Test-provider' + result['pragma_suffix'], cachedCommitPragma('Test-provider', null))
}

// Assemble the ftest args
// Assemble the ftest args from either the build parameters or commit pragmas
result['ftest_arg'] = ''
if (ftest_arg_nvme) {
result['ftest_arg'] += ' --nvme=' + ftest_arg_nvme
}
if (ftest_arg_repeat) {
result['ftest_arg'] += ' --repeat=' + ftest_arg_repeat
}
result['ftest_arg'] += get_param_or_pragma('TestNvme', 'Test-nvme', '--nvme', ftest_arg_nvme)
result['ftest_arg'] += get_param_or_pragma('TestRepeat', 'Test-repeat', '--repeat', null)
if (ftest_arg_provider) {
// Use the specific provider defined by the stage
result['ftest_arg'] += ' --provider=' + ftest_arg_provider
} else {
// Only use a build parameter or commit pragma provider for non-provider-specific stages
result['ftest_arg'] += get_param_or_pragma(
'TestProvider', 'Test-provider', '--provider', null)
}
result['ftest_arg'] += get_param_or_pragma(
'TestStorageTier', 'Test-storage-tier', '--storage_tier', null)
if (result['ftest_tag']) {
result['ftest_tag'] = result['ftest_tag'].trim()
}
Expand Down