Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DAOS-11624 test: Adding support for the Test-storage-tier pragma #355

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -336,7 +336,7 @@ pipeline {
// lots more test cases could be cooked up, to be sure
script {
stages = [[name: 'Fake CentOS 7 Functional stage',
tag: '-hw'],
tag: '-hw',],
[name: 'Fake CentOS 7 Functional Hardware Medium stage',
tag: 'hw,medium,-provider'],
[name: 'Fake CentOS 7 Functional Hardware Medium Provider stage',
43 changes: 20 additions & 23 deletions vars/parseStageInfo.groovy
Original file line number Diff line number Diff line change
@@ -70,6 +70,14 @@ String get_commit_pragma_tags(String pragma_suffix) {
return pragma_tag
}

String get_param_or_pragma(param, pragma, pragma_suffix, launch_arg, predefined) {
// Get the launch.py argument value from either the build parameter, stage-specific commit
// pragma, general commit pragma, or predefined value
String res = params.$param ?: cachedCommitPragma(
pragma + pragma_suffix, cachedCommitPragma(pragma, predefined))

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

/* groovylint-disable-next-line MethodSize */
void call(Map config = [:]) {
@@ -206,7 +214,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'
@@ -285,32 +292,22 @@ 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', result['pragma_suffix'],'--nvme', ftest_arg_nvme)
result['ftest_arg'] += get_param_or_pragma(
'TestRepeat', 'Test-repeat', result['pragma_suffix'], '--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', result['pragma_suffix'], '--provider', null)
}
result['ftest_arg'] += get_param_or_pragma(
'TestStorageTier', 'Test-storage-tier', result['pragma_suffix'], '--storage_tier', null)
if (result['ftest_tag']) {
result['ftest_tag'] = result['ftest_tag'].trim()
}