@@ -25,64 +25,63 @@ Map call(Map kwargs = [:]) {
2525 Boolean run_if_pr = kwargs[' run_if_pr' ] ?: false
2626 String target_branch = env. CHANGE_TARGET ? env. CHANGE_TARGET : env. BRANCH_NAME
2727
28- echo " [${ env.STAGE_NAME} ] Running skipFunctionalTestStage: " +
29- " tags=${ tags} , pragma_suffix=${ pragma_suffix} , size=${ size} , distro=${ distro} , " +
30- " build_param=${ build_param} , build_param_value=${ build_param_value} , " +
31- " run_if_landing=${ run_if_landing} , run_if_pr=${ run_if_pr} , " +
32- " changeRequest()=${ changeRequest()} , startedByUser()=${ startedByUser()} , " +
33- " startedByTimer()=${ startedByTimer()} , " +
34- " startedByUpstream()=${ startedByUpstream()} , target_branch=${ target_branch} "
28+ println (" [${ env.STAGE_NAME} ] Running skipFunctionalTestStage: " +
29+ " tags=${ tags} , pragma_suffix=${ pragma_suffix} , size=${ size} , distro=${ distro} , " +
30+ " build_param=${ build_param} , build_param_value=${ build_param_value} , " +
31+ " run_if_landing=${ run_if_landing} , run_if_pr=${ run_if_pr} , " +
32+ " startedByUser()=${ startedByUser()} , startedByTimer()=${ startedByTimer()} , " +
33+ " startedByUpstream()=${ startedByUpstream()} , target_branch=${ target_branch} " )
3534
3635 // Regardless of how the stage has been started always skip a stage that has either already
3736 // passed or does not contain any tests match the tags.
3837 if (stageAlreadyPassed()) {
39- echo " [${ env.STAGE_NAME} ] Skipping the stage due to all tests passing in the previous build"
38+ println ( " [${ env.STAGE_NAME} ] Skipping the stage due to all tests passing in the previous build" )
4039 return true
4140 }
4241 if (! testsInStage(tags)) {
43- echo " [${ env.STAGE_NAME} ] Skipping the stage due to detecting no tests matching the '${ tags} ' tags"
42+ println ( " [${ env.STAGE_NAME} ] Skipping the stage due to detecting no tests matching the '${ tags} ' tags" )
4443 return true
4544 }
4645
4746 // If the stage has been started by the user, e.g. Build with Parameters, or a timer, or an
4847 // upstream build then use the stage's build parameter (check box) to determine if the stage
4948 // should be run or skipped.
50- if (! changeRequest() && (build_param_value == ' false' )) {
51- echo " [${ env.STAGE_NAME} ] Skipping the stage in user started build due to ${ build_param} param"
52- return true
53- }
54- if (! changeRequest() && (build_param_value == ' true' )) {
55- echo " [${ env.STAGE_NAME} ] Running the stage in user started build due to ${ build_param} param"
56- return false
57- }
5849 if (startedByTimer() && (build_param_value == ' false' )) {
59- echo " [${ env.STAGE_NAME} ] Skipping the stage in timer started build due to ${ build_param} param"
50+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in timer started build due to ${ build_param} param" )
6051 return true
6152 }
6253 if (startedByTimer() && (build_param_value == ' true' )) {
63- echo " [${ env.STAGE_NAME} ] Running the stage in timer started build due to ${ build_param} param"
54+ println ( " [${ env.STAGE_NAME} ] Running the stage in timer started build due to ${ build_param} param" )
6455 return false
6556 }
6657 if (startedByUpstream() && (build_param_value == ' false' )) {
67- echo " [${ env.STAGE_NAME} ] Skipping the stage in an upstream build due to ${ build_param} param"
58+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in an upstream build due to ${ build_param} param" )
6859 return true
6960 }
7061 if (startedByUpstream() && (build_param_value == ' true' )) {
71- echo " [${ env.STAGE_NAME} ] Running the stage in an upstream build due to ${ build_param} param"
62+ println (" [${ env.STAGE_NAME} ] Running the stage in an upstream build due to ${ build_param} param" )
63+ return false
64+ }
65+ if (startedByUser() && (build_param_value == ' false' )) {
66+ println (" [${ env.STAGE_NAME} ] Skipping the stage in user started build due to ${ build_param} param" )
67+ return true
68+ }
69+ if (startedByUser() && (build_param_value == ' true' )) {
70+ println (" [${ env.STAGE_NAME} ] Running the stage in user started build due to ${ build_param} param" )
7271 return false
7372 }
7473
7574 if (env. UNIT_TEST && env. UNIT_TEST == ' true' ) {
76- echo " [${ env.STAGE_NAME} ] Ignoring the landing build check due to Unit Testing"
75+ println ( " [${ env.STAGE_NAME} ] Ignoring the landing build check due to Unit Testing" )
7776 } else {
7877 // If the stage is being run in a landing build use the 'run_if_landing' input to determine
7978 // whether the stage should be run or skipped.
8079 if (startedByLanding() && ! run_if_landing) {
81- echo " [${ env.STAGE_NAME} ] Skipping the stage in a landing build on master/release branch"
80+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in a landing build on master/release branch" )
8281 return true
8382 }
8483 if (startedByLanding() && run_if_landing) {
85- echo " [${ env.STAGE_NAME} ] Running the stage in a landing build on master/release branch"
84+ println ( " [${ env.STAGE_NAME} ] Running the stage in a landing build on master/release branch" )
8685 return false
8786 }
8887 }
@@ -106,10 +105,10 @@ Map call(Map kwargs = [:]) {
106105 for (commit_pragma in commit_pragmas + skip_pragmas) {
107106 String value = (commit_pragma. startsWith(' Skip-' ) || (commit_pragma == ' Run-GHA' )) ? ' true' : ' false'
108107 if (env. UNIT_TEST && env. UNIT_TEST == ' true' ) {
109- echo " [${ env.STAGE_NAME} ] Checking if stage should be skipped with ${ commit_pragma} == ${ value} "
108+ println ( " [${ env.STAGE_NAME} ] Checking if stage should be skipped with ${ commit_pragma} == ${ value} " )
110109 }
111110 if (cachedCommitPragma(commit_pragma, ' ' ). toLowerCase() == value) {
112- echo " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to '${ commit_pragma} : ${ value} ' commit pragma"
111+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to '${ commit_pragma} : ${ value} ' commit pragma" )
113112 return true
114113 }
115114 }
@@ -119,44 +118,44 @@ Map call(Map kwargs = [:]) {
119118 for (commit_pragma in commit_pragmas) {
120119 String value = commit_pragma. startsWith(' Run-' ) ? ' true' : ' false'
121120 if (env. UNIT_TEST && env. UNIT_TEST == ' true' ) {
122- echo " [${ env.STAGE_NAME} ] Checking if stage should be run with ${ commit_pragma} == ${ value} "
121+ println ( " [${ env.STAGE_NAME} ] Checking if stage should be run with ${ commit_pragma} == ${ value} " )
123122 }
124123 if (cachedCommitPragma(commit_pragma, ' ' ). toLowerCase() == value) {
125- echo " [${ env.STAGE_NAME} ] Running the stage in commit build due to '${ commit_pragma} : ${ value} ' commit pragma"
124+ println ( " [${ env.STAGE_NAME} ] Running the stage in commit build due to '${ commit_pragma} : ${ value} ' commit pragma" )
126125 return false
127126 }
128127 }
129128
130129 // If the stage is being run in a build started by a commit with only documentation changes,
131130 // skip the stage.
132131 if (docOnlyChange(target_branch) && prRepos(distro) == ' ' ) {
133- echo " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to document only file changes"
132+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to document only file changes" )
134133 return true
135134 }
136135
137136 // If the stage is being run in a build started by a commit, skip the build if
138137 // DAOS_STACK_CI_HARDWARE_SKIP is set.
139138 if (env. DAOS_STACK_CI_HARDWARE_SKIP == ' true' ) {
140- echo " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to DAOS_STACK_CI_HARDWARE_SKIP parameter"
139+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to DAOS_STACK_CI_HARDWARE_SKIP parameter" )
141140 return true
142141 }
143142
144143 // If the stage is being run in a PR build started by a commit, skip the stage if 'run_if_pr' is
145144 // not set.
146145 /* groovylint-disable-next-line UnnecessaryGetter */
147146 if (isPr() && ! run_if_pr) {
148- echo " [${ env.STAGE_NAME} ] Skipping the stage in commit PR build (override with '${ commit_pragmas[0]} : false')"
147+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in commit PR build (override with '${ commit_pragmas[0]} : false')" )
149148 return true
150149 }
151150
152151 // If the stage is being run in a build started by a commit skip, finally use the stage's
153152 // build parameter to determine if the stage should be skipped.
154153 if (build_param_value == ' false' ) {
155- echo " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to ${ build_param} param"
154+ println ( " [${ env.STAGE_NAME} ] Skipping the stage in commit build due to ${ build_param} param" )
156155 return true
157156 }
158157
159158 // Otherwise run the stage
160- echo " [${ env.STAGE_NAME} ] Running the stage in a commit build"
159+ println ( " [${ env.STAGE_NAME} ] Running the stage in a commit build" )
161160 return false
162161}
0 commit comments