Skip to content

Commit 57bff28

Browse files
authored
DAOS-16683 test: Add support for feature branches (#447)
Treat landing builds on feature branches the same as master. Treat skipping unstable builds on feature branches the same as master. Signed-off-by: Phil Henderson <[email protected]>
1 parent dd28809 commit 57bff28

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

vars/branchTypeRE.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ String call(String branch_type) {
3636
// Also support older branch names not ending in 'testing'
3737
return(testBranchRE())
3838

39+
case 'feature':
40+
// Match a feature branch name
41+
return(/^feature\//)
42+
3943
default:
4044
error "Unsupported branch type: ${branch_type}"
4145
}

vars/skipStage.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ boolean skip_ftest_hw(String size, String target_branch, String tags) {
111111
skip_stage_pragma('func-test-hw-' + size) ||
112112
skip_stage_pragma('func-hw-test') ||
113113
skip_stage_pragma('func-hw-test-' + size) ||
114-
((env.BRANCH_NAME == 'master' ||
115-
env.BRANCH_NAME =~ branchTypeRE('release')) &&
116-
!(startedByTimer() || startedByUser())) ||
114+
startedByLanding() ||
117115
(docOnlyChange(target_branch) &&
118116
prRepos(distro) == '') ||
119117
/* groovylint-disable-next-line UnnecessaryGetter */
@@ -125,6 +123,7 @@ boolean skip_if_unstable() {
125123
cachedCommitPragma('Allow-unstable-test').toLowerCase() == 'true' ||
126124
env.BRANCH_NAME == 'master' ||
127125
env.BRANCH_NAME =~ branchTypeRE('testing') ||
126+
env.BRANCH_NAME =~ branchTypeRE('feature') ||
128127
env.BRANCH_NAME =~ branchTypeRE('release')) {
129128
return false
130129
}

vars/startedByLanding.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* @return a Boolean indicating if this build was started by landing a commit
77
*/
88
Boolean call(Map config = [:]) {
9-
return (env.BRANCH_NAME == 'master' || env.BRANCH_NAME =~ branchTypeRE('release')) &&
10-
!(startedByTimer() || startedByUser())
9+
return (env.BRANCH_NAME == 'master' ||
10+
env.BRANCH_NAME =~ branchTypeRE('release') ||
11+
env.BRANCH_NAME =~ branchTypeRE('feature')) &&
12+
!(startedByTimer() || startedByUser())
1113
}

0 commit comments

Comments
 (0)