@@ -70,6 +70,12 @@ String get_commit_pragma_tags(String pragma_suffix) {
70
70
return pragma_tag
71
71
}
72
72
73
+ String get_param_or_pragma (param , pragma , arg , predefined ) {
74
+ String res = params. $param ?: cachedCommitPragma(
75
+ pragma + result[' pragma_suffix' ], cachedCommitPragma(pragma, predefined))
76
+
77
+ return res ? ' ' + arg + ' = ' + res : ' '
78
+ }
73
79
74
80
/* groovylint-disable-next-line MethodSize */
75
81
void call (Map config = [:]) {
@@ -206,9 +212,7 @@ void call(Map config = [:]) {
206
212
207
213
String cluster_size = ' '
208
214
String ftest_arg_nvme = ' '
209
- String ftest_arg_repeat = ' '
210
215
String ftest_arg_provider = ' '
211
- String ftest_arg_storage_tier = ' '
212
216
if (stage_name. contains(' Functional' )) {
213
217
result[' test' ] = ' Functional'
214
218
result[' node_count' ] = 9
@@ -286,39 +290,20 @@ void call(Map config = [:]) {
286
290
tag = tag. trim()
287
291
}
288
292
289
- // Get the ftest --nvme argument from either the build parameters or commit pragmas
290
- ftest_arg_nvme = params.TestNvme ?: cachedCommitPragma(
291
- ' Test-nvme' + result[' pragma_suffix' ], cachedCommitPragma(' Test-nvme' , ftest_arg_nvme))
292
-
293
- // Get the ftest --repeat argument from either the build parameters or commit pragmas
294
- ftest_arg_repeat = params.TestRepeat ?: cachedCommitPragma(
295
- ' Test-repeat' + result[' pragma_suffix' ], cachedCommitPragma(' Test-repeat' , null ))
296
-
297
- // Get the ftest --provider argument from either the build parameters or commit pragmas if not
298
- // already defined by the stage
299
- if (! ftest_arg_provider) {
300
- ftest_arg_provider = params.TestProvider ?: cachedCommitPragma(
301
- ' Test-provider' + result[' pragma_suffix' ], cachedCommitPragma(' Test-provider' , null ))
302
- }
303
-
304
- // Get the ftest --storage_tier argument from either the build parameters or commit pragmas
305
- ftest_arg_storage_tier = params.TestStorageTier ?: cachedCommitPragma(
306
- ' Test-storage-tier' + result[' pragma_suffix' ], cachedCommitPragma(' Test-storage-tier' , null ))
307
-
308
- // Assemble the ftest args
293
+ // Assemble the ftest args from either the build parameters or commit pragmas
309
294
result[' ftest_arg' ] = ' '
310
- if (ftest_arg_nvme) {
311
- result[' ftest_arg' ] + = ' --nvme=' + ftest_arg_nvme
312
- }
313
- if (ftest_arg_repeat) {
314
- result[' ftest_arg' ] + = ' --repeat=' + ftest_arg_repeat
315
- }
295
+ result[' ftest_arg' ] + = get_param_or_pragma(' TestNvme' , ' Test-nvme' , ' --nvme' , ftest_arg_nvme)
296
+ result[' ftest_arg' ] + = get_param_or_pragma(' TestRepeat' , ' Test-repeat' , ' --repeat' , null )
316
297
if (ftest_arg_provider) {
298
+ // Use the specific provider defined by the stage
317
299
result[' ftest_arg' ] + = ' --provider=' + ftest_arg_provider
300
+ } else {
301
+ // Only use a build parameter or commit pragma provider for non-provider-specific stages
302
+ result[' ftest_arg' ] + = get_param_or_pragma(
303
+ ' TestProvider' , ' Test-provider' , ' --provider' , null )
318
304
}
319
- if (ftest_arg_storage_tier) {
320
- result[' ftest_arg' ] + = ' --storage_tier=' + ftest_arg_storage_tier
321
- }
305
+ result[' ftest_arg' ] + = get_param_or_pragma(
306
+ ' TestStorageTier' , ' Test-storage-tier' , ' --storage_tier' , null )
322
307
if (result[' ftest_tag' ]) {
323
308
result[' ftest_tag' ] = result[' ftest_tag' ]. trim()
324
309
}
0 commit comments