Skip to content

Commit 79f104a

Browse files
committed
DAOS-13527 test: Support default tag assignment through Jenkinsfile
The test tags to use the functional test stages should be driven by the method through which the user has started the build. If the build has been built with parameters or started by a timer then the parameters of that build should drive the test tag selection. If the user pushes a PR then any tags defined via commit pragmas should be used followed by the any build parameter tags. Signed-off-by: Phil Henderson <phillip.henderson@intel.com>
1 parent 1aed1d4 commit 79f104a

File tree

1 file changed

+31
-23
lines changed

1 file changed

+31
-23
lines changed

vars/parseStageInfo.groovy

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -274,34 +274,42 @@ Map call(Map config = [:]) {
274274
}
275275

276276
// Determine which tests tags to use
277-
String tag
278-
if (startedByUser() || startedByUpstream()) {
279-
// Test tags defined by the build parameters override all other tags
280-
tag = get_build_params_tags()
281-
}
282-
if (!tag && startedByTimer()) {
283-
// Stage defined tags take precedence in timed builds
284-
tag = config['test_tag']
285-
if (!tag) {
286-
// Otherwise use the default timed build tags
287-
tag = 'pr daily_regression'
288-
if (env.BRANCH_NAME.startsWith('weekly-testing')) {
289-
tag = 'full_regression'
277+
// config Build Param Commit Pragma
278+
// Started by 'test_tag' (TestTag) (Test-tag) Default Use
279+
// -------------- ---------- ---------- ------------- ---------- ----------
280+
// PR | Upstream None None None defaul_tag defaul_tag
281+
// PR | Upstream None None commit_tag defaul_tag commit_tag
282+
// PR | Upstream None param_tag None defaul_tag param_tag
283+
// PR | Upstream None param_tag commit_tag defaul_tag commit_tag
284+
// Manual | Timer None None <any> defaul_tag defaul_tag
285+
// Manual | Timer None param_tag <any> defaul_tag param_tag
286+
// <any> config_tag <any> <any> <any> config_tag
287+
//
288+
String tag = config['test_tag']
289+
if (!tag) {
290+
if (startedByUser() || startedByTimer()) {
291+
// Get tags from the build parameters
292+
tag = get_build_params_tags()
293+
if (!tag) {
294+
// Default to the pr tag for any other build stage
295+
tag = 'pr'
290296
}
291297
}
292-
} else if (!tag) {
293-
if (env.BRANCH_NAME.matches(testBranchRE())) {
294-
tag = 'always_passes'
295-
} else {
296-
// Tags defined by commit pragmas have priority in user PRs
298+
else {
299+
// Get tags from the commit pragmas
297300
tag = get_commit_pragma_tags(result['pragma_suffix'])
298301
if (!tag) {
299-
// Followed by stage defined tags
300-
tag = config['test_tag']
301-
/* groovylint-disable-next-line CouldBeElvis */
302+
// Get tags from the build parameters
303+
tag = get_build_params_tags()
302304
if (!tag) {
303-
// Otherwise use the default PR tag
304-
tag = 'pr'
305+
if (startedByUpstream()) {
306+
// Default to run simple tests for dowstream builds
307+
tag = 'always_passes'
308+
}
309+
else {
310+
// Default to the pr tag for any other build stage
311+
tag = 'pr'
312+
}
305313
}
306314
}
307315
}

0 commit comments

Comments
 (0)