Skip to content
Open
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions vars/parseStageInfo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ void call(Map config = [:]) {
String ftest_arg_nvme = ''
String ftest_arg_repeat = ''
String ftest_arg_provider = ''
String ftest_arg_storage_tier = ''
if (stage_name.contains('Functional')) {
result['test'] = 'Functional'
result['node_count'] = 9
Expand Down Expand Up @@ -300,6 +301,10 @@ void call(Map config = [:]) {
'Test-provider' + result['pragma_suffix'], cachedCommitPragma('Test-provider', null))
}

// Get the ftest --storage_tier argument from either the build parameters or commit pragmas
ftest_arg_storage_tier = params.TestStorageTier ?: cachedCommitPragma(
'Test-storage-tier' + result['pragma_suffix'], cachedCommitPragma('Test-storage-tier', null))

// Assemble the ftest args
result['ftest_arg'] = ''
if (ftest_arg_nvme) {
Expand All @@ -311,6 +316,9 @@ void call(Map config = [:]) {
if (ftest_arg_provider) {
result['ftest_arg'] += ' --provider=' + ftest_arg_provider
}
if (ftest_arg_storage_tier) {
result['ftest_arg'] += ' --storage_tier=' + ftest_arg_storage_tier
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth mentioning that this could be made more succinct with:

Suggested change
if (ftest_arg_storage_tier) {
result['ftest_arg'] += ' --storage_tier=' + ftest_arg_storage_tier
}
result['ftest_arg'] += ftest_arg_storage_tier ? ' --storage_tier=' + ftest_arg_storage_tier : ''

Or that a function could be written to make all of this more DRY, now that it's evident that it's proliferating. I.e.

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

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

result['ftest_arg'] += get_param_or_pragma('TestStorageTier', 'Test-storage-tier', '--storage_tier')

And of course using the above for all of the other param-or-pragma values that are built into result['ftest_arg'].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've added this change.

if (result['ftest_tag']) {
result['ftest_tag'] = result['ftest_tag'].trim()
}
Expand Down