Skip to content

Commit 50168a6

Browse files
DAOS-15232 ci: support Test-tag and Features pragmas together (#425)
Support both Test-tag and Features pragmas by always looking for Features and appending to the Test-tag Signed-off-by: Dalton Bohning <[email protected]>
1 parent b9c05f6 commit 50168a6

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

Jenkinsfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,22 @@ pipeline {
546546
tag_template: '@commits.value@,@stages.tag@'],
547547
[tags: [[tag: 'Features', value: 'datamover']],
548548
tag_template: 'pr,@stages.tag@ ' +
549+
'pr,@commits.value@,@stages.tag@ ' +
549550
'daily_regression,@commits.value@,@stages.tag@ ' +
550551
'full_regression,@commits.value@,@stages.tag@'],
551552
/* groovylint-disable-next-line DuplicateMapLiteral */
552553
[tags: [[tag: 'Test-tag', value: 'datamover'],
553554
[tag: 'Features', value: 'foobar']],
554-
tag_template: '@commits.value@,@stages.tag@'],
555+
tag_template: '@commits.value@,@stages.tag@ ' +
556+
'pr,foobar,@stages.tag@ ' +
557+
'daily_regression,foobar,@stages.tag@ ' +
558+
'full_regression,foobar,@stages.tag@'],
555559
[tags: [[tag: 'Features', value: 'datamover foobar']],
556560
tag_template: 'pr,@stages.tag@ ' +
561+
'pr,datamover,@stages.tag@ ' +
557562
'daily_regression,datamover,@stages.tag@ ' +
558563
'full_regression,datamover,@stages.tag@ ' +
564+
'pr,foobar,@stages.tag@ ' +
559565
'daily_regression,foobar,@stages.tag@ ' +
560566
'full_regression,foobar,@stages.tag@'],
561567
[tags: [[tag: 'Test-tag', value: 'datamover foobar']],

vars/getFunctionalTags.groovy

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Map call(Map kwargs = [:]) {
1515
String pragma_suffix = kwargs.get('pragma_suffix', getPragmaSuffix())
1616
String stage_tags = kwargs.get('stage_tags', getFunctionalStageTags())
17-
String default_tags = kwargs.get('default_tags', '')
17+
String default_tags = kwargs.get('default_tags', 'pr')
1818
String requested_tags = ''
1919

2020
// Define the test tags to use in this stage
@@ -30,22 +30,21 @@ Map call(Map kwargs = [:]) {
3030
// Builds started from a commit should first use any commit pragma 'Test-tag*:' tags if defined
3131
requested_tags = commitPragma('Test-tag' + pragma_suffix, commitPragma('Test-tag', ''))
3232
}
33-
if (!requested_tags) {
34-
// Builds started from a commit should then use any commit pragma 'Features:' tags if defined
35-
String features = commitPragma('Features', '')
36-
if (features) {
37-
// Features extend the standard pr testing tags to include tests run in daily or weekly builds
38-
// that test the specified feature.
39-
requested_tags = 'pr'
40-
for (feature in features.split(' ')) {
41-
requested_tags += ' daily_regression,' + feature + ' full_regression,' + feature
42-
}
43-
}
44-
}
4533
if (!requested_tags) {
4634
// Builds started from a commit should finally use the default tags for the stage
4735
requested_tags = default_tags
4836
}
37+
38+
// Append any commit pragma 'Features:' tags if defined
39+
String features = commitPragma('Features', '')
40+
if (features) {
41+
// Features extend the standard testing tags to include tests run in pr, daily, or weekly builds
42+
// that test the specified feature.
43+
// We should eventually not need to filter by pr, daily, weekly when all tests are tagged appropriately.
44+
for (feature in features.split(' ')) {
45+
requested_tags += ' pr,' + feature + ' daily_regression,' + feature + ' full_regression,' + feature
46+
}
47+
}
4948
if (requested_tags) {
5049
requested_tags = requested_tags.trim()
5150
}

0 commit comments

Comments
 (0)