Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 1 | // Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // voltha-2.x e2e tests for openonu-go |
| 16 | // uses bbsim to simulate OLT/ONUs |
| 17 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 18 | // [TODO] Update syntax below to the latest supported |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 19 | library identifier: 'cord-jenkins-libraries@master', |
| 20 | retriever: modernSCM([ |
| 21 | $class: 'GitSCMSource', |
| 22 | remote: 'https://gerrit.opencord.org/ci-management.git' |
| 23 | ]) |
| 24 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 25 | //------------------// |
| 26 | //---] GLOBAL [---// |
| 27 | //------------------// |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 28 | String clusterName = 'kind-ci' // was def |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 29 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 30 | // ----------------------------------------------------------------------- |
| 31 | // Intent: |
| 32 | // ----------------------------------------------------------------------- |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 33 | String branchName() { |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 34 | String name = 'voltha-2.12' |
| 35 | |
| 36 | // [TODO] Sanity check the target branch |
| 37 | // if (name != jenkins.branch) { fatal } |
| 38 | return(name) |
| 39 | } |
| 40 | |
| 41 | // ----------------------------------------------------------------------- |
| 42 | // Intent: Due to lack of a reliable stack trace, construct a literal. |
| 43 | // Jenkins will re-write the call stack for serialization. |
| 44 | // ----------------------------------------------------------------------- |
| 45 | String getIam(String func) { |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 46 | String branchName = branchName() |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 47 | String src = [ |
| 48 | 'ci-management', |
| 49 | 'jjb', |
| 50 | 'pipeline', |
| 51 | 'voltha', |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 52 | branchName, |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 53 | 'bbsim-tests.groovy' |
| 54 | ].join('/') |
| 55 | |
| 56 | String name = [src, func].join('::') |
| 57 | return(name) |
| 58 | } |
| 59 | |
| 60 | // ----------------------------------------------------------------------- |
| 61 | // Intent: Determine if working on a release branch. |
| 62 | // Note: Conditional is legacy, should also check for *-dev or *-pre |
| 63 | // ----------------------------------------------------------------------- |
| 64 | Boolean isReleaseBranch(String name) |
| 65 | { |
| 66 | // List modifiers = ['-dev', '-pre', 'voltha-x.y.z-pre'] |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 67 | // if branchName in modifiers |
| 68 | return(name != 'master') // OR branchName.contains('-') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 69 | } |
| 70 | |
| 71 | // ----------------------------------------------------------------------- |
| 72 | // Intent: |
| 73 | // ----------------------------------------------------------------------- |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 74 | void execute_test(testTarget, workflow, testLogging, teardown, testSpecificHelmFlags='') |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 75 | { |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 76 | String infraNamespace = 'default' |
| 77 | String volthaNamespace = 'voltha' |
| 78 | String logsDir = "$WORKSPACE/${testTarget}" |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 79 | |
| 80 | stage('IAM') |
| 81 | { |
| 82 | script |
| 83 | { |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 84 | // Announce ourselves for log usability |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 85 | String iam = getIam('execute_test') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 86 | println("${iam}: ENTER") |
| 87 | println("${iam}: LEAVE") |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 88 | } |
| 89 | } |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 90 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 91 | // ----------------------------------------------------------------------- |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 92 | // Intent: Cleanup stale port-forwarding |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 93 | // ----------------------------------------------------------------------- |
| 94 | stage('Cleanup') |
| 95 | { |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 96 | if (teardown) { |
| 97 | timeout(15) { |
| 98 | script { |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 99 | helmTeardown(['default', infraNamespace, volthaNamespace]) |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 100 | } |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 101 | |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 102 | // ----------------------------------------------------------------------- |
| 103 | // Verify pgrep/pkill behavior before replacing ps | kill -9 |
| 104 | // ----------------------------------------------------------------------- |
| 105 | script { |
| 106 | println(''' |
| 107 | |
| 108 | ** ----------------------------------------------------------------------- |
| 109 | ** pgrep process list for port-forward (pre-pkill) |
| 110 | ** ----------------------------------------------------------------------- |
| 111 | ''') |
| 112 | sh('''pgrep --list-full port-forward || true''') |
| 113 | } |
| 114 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 115 | // Comment timeout() if we hang (fix it VS mask problem) |
| 116 | // timeout(1) { |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 117 | // ----------------------------------------------------------------------- |
| 118 | // ----------------------------------------------------------------------- |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 119 | sh(returnStdout:true, script: ''' |
| 120 | sync |
| 121 | cat <<EOM |
| 122 | |
| 123 | ** ----------------------------------------------------------------------- |
| 124 | ** remove orphaned port-forward from different namespacse |
| 125 | ** ----------------------------------------------------------------------- |
| 126 | EOM |
| 127 | [[ $(pgrep --count port-forward) -gt 0 ]] && pkill --echo 'port-forward' |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 128 | ''') |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 129 | |
| 130 | // ----------------------------------------------------------------------- |
| 131 | // ----------------------------------------------------------------------- |
| 132 | script { |
| 133 | println(''' |
| 134 | |
| 135 | ** ----------------------------------------------------------------------- |
| 136 | ** pgrep process list for port-forward (post-pkill) |
| 137 | ** ----------------------------------------------------------------------- |
| 138 | ''') |
| 139 | sh('''pgrep --list-full port-forward || true''') |
| 140 | } |
| 141 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 142 | } // timeout(15) |
| 143 | } // teardown() |
| 144 | // timeout(1) |
| 145 | } // stage(cleanup) |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 146 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 147 | // ----------------------------------------------------------------------- |
| 148 | // ----------------------------------------------------------------------- |
| 149 | stage('Deploy common infrastructure') |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 150 | { |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 151 | script |
| 152 | { |
| 153 | local dashargs = [ |
| 154 | 'kpi_exporter.enabled=false', |
| 155 | 'dashboards.xos=false', |
| 156 | 'dashboards.onos=false', |
| 157 | 'dashboards.aaa=false', |
| 158 | 'dashboards.voltha=false', |
| 159 | ].join(',') |
| 160 | |
| 161 | local promargs = [ |
| 162 | 'prometheus.alertmanager.enabled=false', |
| 163 | 'prometheus.pushgateway.enabled=false', |
| 164 | ].join(',') |
| 165 | |
| 166 | sh(''' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 167 | helm repo add onf https://charts.opencord.org |
| 168 | helm repo update |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 169 | |
| 170 | echo -e "\nwithMonitoring=[$withMonitoring]" |
| 171 | if [ ${withMonitoring} = true ] ; then |
| 172 | helm install nem-monitoring onf/nem-monitoring \ |
| 173 | --set $promargs \ |
| 174 | --set $dashargs |
| 175 | fi |
| 176 | ''') |
| 177 | |
| 178 | /* |
| 179 | sh ''' |
| 180 | helm repo add onf https://charts.opencord.org |
| 181 | helm repo update |
| 182 | |
| 183 | echo -e "\nwithMonitoring=[$withMonitoring]" |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 184 | if [ ${withMonitoring} = true ] ; then |
| 185 | helm install nem-monitoring onf/nem-monitoring \ |
| 186 | --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \ |
| 187 | --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false |
| 188 | fi |
| 189 | ''' |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 190 | */ |
| 191 | } |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 192 | } |
| 193 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 194 | // ----------------------------------------------------------------------- |
| 195 | // ----------------------------------------------------------------------- |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 196 | stage('Deploy Voltha') |
| 197 | { |
| 198 | if (teardown) |
| 199 | { |
| 200 | timeout(10) |
| 201 | { |
| 202 | script |
| 203 | { |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 204 | sh(""" |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 205 | mkdir -p ${logsDir} |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 206 | onos_log="${logsDir}/onos-voltha-startup-combined.log" |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 207 | echo "** kail-startup ENTER: \$(date)" > "$onos_log" |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 208 | |
| 209 | # Intermixed output (tee -a &) may get conflusing but let(s) see |
| 210 | # what messages are logged during startup. |
| 211 | # _TAG=kail-startup kail -n ${infraNamespace} -n ${volthaNamespace} >> "$onos_log" & |
| 212 | _TAG=kail-startup kail -n ${infraNamespace} -n ${volthaNamespace} | tee -a "$onos_log" & |
| 213 | """) |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 214 | |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 215 | // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 216 | Boolean localCharts = false |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 217 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 218 | if (volthaHelmChartsChange != '' |
| 219 | || gerritProject == 'voltha-helm-charts' |
| 220 | || isReleaseBranch(branch) // branch != 'master' |
| 221 | ) { |
| 222 | localCharts = true |
| 223 | } |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 224 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 225 | String branchName = branchName() |
| 226 | Boolean is_release = isReleaseBranch(branch) |
| 227 | println([ |
| 228 | " ** localCharts=${localCharts}", |
| 229 | "branchName=${branchName}", |
| 230 | "branch=${branch}", |
| 231 | "branch=isReleaseBranch=${is_release}", |
| 232 | ].join(', ')) |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 233 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 234 | // ----------------------------------------------------------------------- |
| 235 | // Rewrite localHelmFlags using array join, moving code around and |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 236 | // refactoring into standalone functions |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 237 | // ----------------------------------------------------------------------- |
| 238 | // hudson.remoting.ProxyException: groovy.lang.MissingMethodException: |
| 239 | // No signature of method: java.lang.String.positive() is applicable for argument types: () values: [] |
| 240 | // ----------------------------------------------------------------------- |
| 241 | // NOTE temporary workaround expose ONOS node ports |
| 242 | // ----------------------------------------------------------------------- |
| 243 | String localHelmFlags = [ |
| 244 | extraHelmFlags.trim(), |
| 245 | "--set global.log_level=${logLevel.toUpperCase()}", |
| 246 | '--set onos-classic.onosSshPort=30115', |
| 247 | '--set onos-classic.onosApiPort=30120', |
| 248 | '--set onos-classic.onosOfPort=31653', |
| 249 | '--set onos-classic.individualOpenFlowNodePorts=true', |
| 250 | testSpecificHelmFlags |
| 251 | ].join(' ') |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 252 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 253 | println("** localHelmFlags = ${localHelmFlags}") |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 254 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 255 | if (gerritProject != '') { |
| 256 | localHelmFlags = "${localHelmFlags} " + getVolthaImageFlags("${gerritProject}") |
| 257 | } |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 258 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 259 | println('volthaDeploy: ENTER') |
| 260 | volthaDeploy([ |
| 261 | infraNamespace: infraNamespace, |
| 262 | volthaNamespace: volthaNamespace, |
| 263 | workflow: workflow.toLowerCase(), |
| 264 | withMacLearning: enableMacLearning.toBoolean(), |
| 265 | extraHelmFlags: localHelmFlags, |
| 266 | localCharts: localCharts, |
| 267 | bbsimReplica: olts.toInteger(), |
| 268 | dockerRegistry: registry, |
| 269 | ]) |
| 270 | println('volthaDeploy: LEAVE') |
| 271 | } // script |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 272 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 273 | // ----------------------------------------------------------------------- |
| 274 | // Intent: Replacing P_IDS with pgrep/pkill is a step forward. |
| 275 | // Why not simply use a pid file, capture _TAG=kail-startup above |
| 276 | // Grep runs the risk of terminating stray commands (??-good <=> bad-??) |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 277 | // ----------------------------------------------------------------------- |
| 278 | script { |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 279 | println(''' |
| 280 | |
| 281 | ** ----------------------------------------------------------------------- |
| 282 | ** pgrep process list for kail-startup (WIP) |
| 283 | ** ----------------------------------------------------------------------- |
| 284 | ''') |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 285 | sh('''pgrep --list-full kail-startup || true''') |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 286 | |
| 287 | println(''' |
| 288 | |
| 289 | ** ----------------------------------------------------------------------- |
| 290 | ** Raw ps process list for kail-startup (WIP) |
| 291 | ** ----------------------------------------------------------------------- |
| 292 | ''') |
| 293 | sh('''ps e -ww -A | grep "_TAG=kail-startup"''') |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 294 | } |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 295 | |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 296 | // ----------------------------------------------------------------------- |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 297 | // stop logging |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 298 | // ----------------------------------------------------------------------- |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 299 | sh """ |
| 300 | P_IDS="\$(ps e -ww -A | grep "_TAG=kail-startup" | grep -v grep | awk '{print \$1}')" |
| 301 | if [ -n "\$P_IDS" ]; then |
| 302 | echo \$P_IDS |
| 303 | for P_ID in \$P_IDS; do |
| 304 | kill -9 \$P_ID |
| 305 | done |
| 306 | fi |
| 307 | cd ${logsDir} |
Joey Armstrong | dddbbf9 | 2023-08-22 16:00:41 -0400 | [diff] [blame] | 308 | echo "** kail-startup LEAVE: \$(date)" >> "${logsDir}/onos-voltha-startup-combined.log" |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 309 | |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 310 | gzip -k onos-voltha-startup-combined.log |
| 311 | rm onos-voltha-startup-combined.log |
| 312 | """ |
| 313 | } |
| 314 | |
| 315 | sh """ |
| 316 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-voltha-api" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/voltha-voltha-api 55555:55555; done"& |
| 317 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-etcd" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-etcd 2379:2379; done"& |
| 318 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="voltha-infra-kafka" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${infraNamespace} svc/voltha-infra-kafka 9092:9092; done"& |
| 319 | bbsimDmiPortFwd=50075 |
| 320 | for i in {0..${olts.toInteger() - 1}}; do |
| 321 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="bbsim\${i}" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n ${volthaNamespace} svc/bbsim\${i} \${bbsimDmiPortFwd}:50075; done"& |
| 322 | ((bbsimDmiPortFwd++)) |
| 323 | done |
| 324 | if [ ${withMonitoring} = true ] ; then |
| 325 | JENKINS_NODE_COOKIE="dontKillMe" _TAG="nem-monitoring-prometheus-server" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n default svc/nem-monitoring-prometheus-server 31301:80; done"& |
| 326 | fi |
| 327 | ps aux | grep port-forward |
| 328 | """ |
| 329 | |
| 330 | // setting ONOS log level |
| 331 | script |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 332 | { |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 333 | println('** setOnosLogLevels: ENTER') |
| 334 | setOnosLogLevels([ |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 335 | onosNamespace: infraNamespace, |
| 336 | apps: [ |
| 337 | 'org.opencord.dhcpl2relay', |
| 338 | 'org.opencord.olt', |
| 339 | 'org.opencord.aaa', |
| 340 | 'org.opencord.maclearner', |
| 341 | 'org.onosproject.net.flowobjective.impl.FlowObjectiveManager', |
| 342 | 'org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager' |
| 343 | ], |
| 344 | logLevel: logLevel |
| 345 | ]) |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 346 | println('** setOnosLogLevels: LEAVE') |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 347 | } // script |
| 348 | } // if (teardown) |
| 349 | } // stage('Deploy Voltha') |
| 350 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 351 | stage("Run test ${testTarget} on workflow ${workflow}") |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 352 | { |
| 353 | sh """ |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 354 | echo -e "\n** Monitor using mem_consumption.py ?" |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 355 | if [ ${withMonitoring} = true ] ; then |
| 356 | mkdir -p "$WORKSPACE/voltha-pods-mem-consumption-${workflow}" |
| 357 | cd "$WORKSPACE/voltha-system-tests" |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 358 | make venv-activate-script |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 359 | set +u && source .venv/bin/activate && set -u |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 360 | # Collect initial memory consumption |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 361 | python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace} |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 362 | fi |
| 363 | """ |
| 364 | |
| 365 | sh """ |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 366 | echo -e "\n** make testTarget=[${testTarget}]" |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 367 | mkdir -p ${logsDir} |
| 368 | export ROBOT_MISC_ARGS="-d ${logsDir} ${params.extraRobotArgs} " |
| 369 | ROBOT_MISC_ARGS+="-v ONOS_SSH_PORT:30115 -v ONOS_REST_PORT:30120 -v NAMESPACE:${volthaNamespace} -v INFRA_NAMESPACE:${infraNamespace} -v container_log_dir:${logsDir} -v logging:${testLogging}" |
| 370 | export KVSTOREPREFIX=voltha/voltha_voltha |
| 371 | |
Joey Armstrong | 0eb8bd8 | 2023-07-10 13:26:25 -0400 | [diff] [blame] | 372 | make -C "$WORKSPACE/voltha-system-tests" ${testTarget} |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 373 | """ |
| 374 | |
| 375 | getPodsInfo("${logsDir}") |
| 376 | |
| 377 | sh """ |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 378 | echo -e '\n** Gather robot Framework logs: ENTER' |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 379 | # set +e |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 380 | # collect logs collected in the Robot Framework StartLogging keyword |
| 381 | cd ${logsDir} |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 382 | gzip *-combined.log |
| 383 | rm -f *-combined.log |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 384 | |
| 385 | echo -e '** Gather robot Framework logs: LEAVE\n' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 386 | """ |
| 387 | |
| 388 | sh """ |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 389 | echo -e '** Monitor pod-mem-consumption: ENTER' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 390 | if [ ${withMonitoring} = true ] ; then |
| 391 | cd "$WORKSPACE/voltha-system-tests" |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 392 | make venv-activate-script |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 393 | set +u && source .venv/bin/activate && set -u |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 394 | # Collect memory consumption of voltha pods once all the tests are complete |
Joey Armstrong | 0eb8bd8 | 2023-07-10 13:26:25 -0400 | [diff] [blame] | 395 | python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace} |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 396 | fi |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 397 | echo -e '** Monitor pod-mem-consumption: LEAVE\n' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 398 | """ |
| 399 | } // stage |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 400 | |
| 401 | return |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 402 | } // execute_test() |
| 403 | |
| 404 | // ----------------------------------------------------------------------- |
| 405 | // ----------------------------------------------------------------------- |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 406 | def collectArtifacts(exitStatus) { |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 407 | String iam = getIam('execute_test') |
| 408 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 409 | echo ''' |
| 410 | |
| 411 | ** ----------------------------------------------------------------------- |
| 412 | ** collectArtifacts |
| 413 | ** ----------------------------------------------------------------------- |
| 414 | ''' |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 415 | println("${iam}: ENTER (exitStatus=${exitStatus})") |
Joey Armstrong | 66fcb4e | 2023-08-11 12:09:24 -0400 | [diff] [blame] | 416 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 417 | getPodsInfo("$WORKSPACE/${exitStatus}") |
Joey Armstrong | 66fcb4e | 2023-08-11 12:09:24 -0400 | [diff] [blame] | 418 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 419 | sh """ |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 420 | kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/${exitStatus}/voltha.log |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 421 | """ |
Joey Armstrong | 66fcb4e | 2023-08-11 12:09:24 -0400 | [diff] [blame] | 422 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 423 | archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt,**/*.html,**/voltha-pods-mem-consumption-att/*,**/voltha-pods-mem-consumption-dt/*,**/voltha-pods-mem-consumption-tt/*' |
Joey Armstrong | 66fcb4e | 2023-08-11 12:09:24 -0400 | [diff] [blame] | 424 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 425 | sh(returnStdout:true, script: ''' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 426 | sync |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 427 | echo '** Running: pgrep --list-full kail-startup (ENTER)' |
| 428 | pgrep --list-full 'kail-startup' || true |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 429 | [[ $(pgrep --count kail) -gt 0 ]] && pkill --echo kail |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 430 | echo '** Running: pgrep --list-full kail-startup (LEAVE)' |
| 431 | ''') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 432 | |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 433 | println("${iam}: ENTER RobotPublisher") |
| 434 | step([$class: 'RobotPublisher', |
| 435 | disableArchiveOutput: false, |
| 436 | logFileName: '**/*/log*.html', |
| 437 | otherFiles: '', |
| 438 | outputFileName: '**/*/output*.xml', |
| 439 | outputPath: '.', |
| 440 | passThreshold: 100, |
| 441 | reportFileName: '**/*/report*.html', |
| 442 | unstableThreshold: 0, |
| 443 | onlyCritical: true]); |
| 444 | println("${iam}: LEAVE RobotPublisher") |
| 445 | |
| 446 | println("${iam}: LEAVE (exitStatus=${exitStatus})") |
| 447 | return |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 448 | } |
| 449 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 450 | // ----------------------------------------------------------------------- |
| 451 | // Intent: main |
| 452 | // ----------------------------------------------------------------------- |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 453 | pipeline { |
| 454 | |
| 455 | /* no label, executor is determined by JJB */ |
| 456 | agent { |
| 457 | label "${params.buildNode}" |
| 458 | } |
| 459 | options { |
| 460 | timeout(time: "${timeout}", unit: 'MINUTES') |
| 461 | } |
| 462 | environment { |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 463 | KUBECONFIG = "$HOME/.kube/kind-${clusterName}" |
| 464 | VOLTCONFIG = "$HOME/.volt/config" |
| 465 | PATH = "$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 466 | DIAGS_PROFILE = 'VOLTHA_PROFILE' |
| 467 | SSHPASS = 'karaf' |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 468 | } |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 469 | |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 470 | stages { |
| 471 | stage('Download Code') { |
| 472 | steps { |
| 473 | getVolthaCode([ |
| 474 | branch: "${branch}", |
| 475 | gerritProject: "${gerritProject}", |
| 476 | gerritRefspec: "${gerritRefspec}", |
| 477 | volthaSystemTestsChange: "${volthaSystemTestsChange}", |
| 478 | volthaHelmChartsChange: "${volthaHelmChartsChange}", |
| 479 | ]) |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | stage('Build patch v1.1') |
| 484 | { |
| 485 | // build the patch only if gerritProject is specified |
| 486 | when |
| 487 | { |
| 488 | expression |
| 489 | { |
| 490 | return !gerritProject.isEmpty() |
| 491 | } |
| 492 | } |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 493 | |
| 494 | steps |
| 495 | { |
| 496 | // NOTE that the correct patch has already been checked out |
| 497 | // during the getVolthaCode step |
| 498 | buildVolthaComponent("${gerritProject}") |
| 499 | } |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 500 | } |
| 501 | |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 502 | // ----------------------------------------------------------------------- |
| 503 | // ----------------------------------------------------------------------- |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 504 | stage('Install Kail') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 505 | { |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 506 | steps |
| 507 | { |
| 508 | script |
| 509 | { |
| 510 | String cmd = [ |
| 511 | 'make', |
Joey Armstrong | 9f184d3 | 2023-08-03 11:34:48 -0400 | [diff] [blame] | 512 | '--no-print-directory', |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 513 | '-C', "$WORKSPACE/voltha-system-tests", |
| 514 | "KAIL_PATH=\"$WORKSPACE/bin\"", |
| 515 | 'kail', |
| 516 | ].join(' ') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 517 | |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 518 | println(" ** Running: ${cmd}:\n") |
| 519 | sh("${cmd}") |
| 520 | } // script |
| 521 | } // steps |
| 522 | } // stage |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 523 | |
| 524 | // ----------------------------------------------------------------------- |
| 525 | // ----------------------------------------------------------------------- |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 526 | stage('Install Kind') |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 527 | { |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 528 | steps |
| 529 | { |
| 530 | script |
| 531 | { |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 532 | |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 533 | String cmd = [ |
| 534 | 'make', |
Joey Armstrong | 9f184d3 | 2023-08-03 11:34:48 -0400 | [diff] [blame] | 535 | '--no-print-directory', |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 536 | '-C', "$WORKSPACE/voltha-system-tests", |
| 537 | "KIND_PATH=\"$WORKSPACE/bin\"", |
| 538 | 'install-command-kind', |
| 539 | ].join(' ') |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 540 | |
Joey Armstrong | 2b2010d | 2023-08-02 21:47:20 -0400 | [diff] [blame] | 541 | println(" ** Running: ${cmd}:\n") |
| 542 | sh("${cmd}") |
| 543 | } // script |
| 544 | } // steps |
| 545 | } // stage |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 546 | |
| 547 | // ----------------------------------------------------------------------- |
| 548 | // ----------------------------------------------------------------------- |
| 549 | stage('Create K8s Cluster') |
| 550 | { |
| 551 | steps |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 552 | { |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 553 | script |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 554 | { |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 555 | def clusterExists = sh( |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 556 | returnStdout: true, |
| 557 | script: """kind get clusters | grep "${clusterName}" | wc -l""" |
| 558 | ) |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 559 | |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 560 | if (clusterExists.trim() == '0') |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 561 | { |
| 562 | createKubernetesCluster([nodes: 3, name: clusterName]) |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 563 | } |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 564 | } // script |
| 565 | } // steps |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 566 | } // stage('Create K8s Cluster') |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 567 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 568 | // ----------------------------------------------------------------------- |
| 569 | // ----------------------------------------------------------------------- |
| 570 | stage('Replace voltctl') |
| 571 | { |
| 572 | // if the project is voltctl, override the downloaded one with the built one |
| 573 | when { |
| 574 | expression { return gerritProject == 'voltctl' } |
| 575 | } |
| 576 | |
| 577 | // Hmmmm(?) where did the voltctl download happen ? |
| 578 | // Likely Makefile but would be helpful to document here. |
| 579 | steps |
| 580 | { |
| 581 | println("${iam} Running: installVoltctl($branch)") |
| 582 | installVoltctl("$branch") |
| 583 | } // steps |
| 584 | } // stage |
| 585 | |
| 586 | // ----------------------------------------------------------------------- |
| 587 | // ----------------------------------------------------------------------- |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 588 | stage('voltctl [DEBUG]') |
| 589 | { |
| 590 | steps |
| 591 | { |
| 592 | println("${iam} Display umask") |
| 593 | sh('umask') |
| 594 | |
| 595 | println("${iam} Checking voltctl config permissions") |
| 596 | sh('/bin/ls -ld ~/.volt || true') |
| 597 | |
| 598 | println("${iam} Running find") |
| 599 | sh('/bin/ls -l ~/.volt') |
| 600 | } // steps |
| 601 | } // stage |
| 602 | |
| 603 | // ----------------------------------------------------------------------- |
| 604 | // ----------------------------------------------------------------------- |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 605 | stage('Load image in kind nodes') |
| 606 | { |
| 607 | when { |
| 608 | expression { return !gerritProject.isEmpty() } |
| 609 | } |
| 610 | steps { |
| 611 | loadToKind() |
| 612 | } // steps |
| 613 | } // stage |
| 614 | |
| 615 | // ----------------------------------------------------------------------- |
| 616 | // ----------------------------------------------------------------------- |
| 617 | stage('Parse and execute tests') |
| 618 | { |
| 619 | steps { |
| 620 | script { |
| 621 | // Announce ourselves for log usability |
| 622 | String iam = getIam('execute_test') |
| 623 | println("${iam}: ENTER") |
| 624 | |
| 625 | def tests = readYaml text: testTargets |
| 626 | |
| 627 | println("** $iam: Testing index: tests-to-run") |
| 628 | tests.eachWithIndex { test, idx -> |
| 629 | String target = test['target'] |
| 630 | println("** $idx: $target") |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 631 | } |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 632 | println("** NOTE: For odd failures compare tests-to-run with teste output") |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 633 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 634 | tests.eachWithIndex { test, idx -> |
| 635 | println "** readYaml test suite[$idx]) test=[${test}]" |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 636 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 637 | String target = test['target'] |
| 638 | String workflow = test['workflow'] |
| 639 | String flags = test['flags'] |
| 640 | Boolean teardown = test['teardown'].toBoolean() |
| 641 | Boolean logging = test['logging'].toBoolean() |
| 642 | String testLogging = (logging) ? 'True' : 'False' |
Joey Armstrong | 0e0a42b | 2023-08-02 21:04:21 -0400 | [diff] [blame] | 643 | |
Joey Armstrong | 268442d | 2023-08-22 17:16:10 -0400 | [diff] [blame^] | 644 | print(""" |
| 645 | |
| 646 | ** ----------------------------------------------------------------------- |
| 647 | ** Executing test ${target} on workflow ${workflow} with logging ${testLogging} and extra flags ${flags}" |
| 648 | ** ----------------------------------------------------------------------- |
| 649 | |
| 650 | ) |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 651 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 652 | try { |
| 653 | println "Executing test ${target}: ENTER" |
| 654 | execute_test(target, workflow, testLogging, teardown, flags) |
| 655 | } |
| 656 | catch (Exception err) { |
| 657 | println("** ${iam}: EXCEPTION ${err}") |
| 658 | } |
| 659 | finally { |
| 660 | println "Executing test ${target}: LEAVE" |
| 661 | } |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 662 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 663 | } // for |
Joey Armstrong | 642540a | 2023-08-10 10:26:36 -0400 | [diff] [blame] | 664 | |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 665 | // Premature exit if this message is not logged |
| 666 | println("${iam}: LEAVE (testing ran to completion)") |
Joey Armstrong | 54dec09 | 2023-08-03 18:21:38 -0400 | [diff] [blame] | 667 | } // script |
| 668 | } // steps |
Joey Armstrong | 008cfaf | 2023-08-18 14:49:06 -0400 | [diff] [blame] | 669 | } // stage |
Joey Armstrong | 7bcb578 | 2023-06-07 12:25:57 -0400 | [diff] [blame] | 670 | } // stages |
| 671 | |
| 672 | post |
| 673 | { |
| 674 | aborted { collectArtifacts('aborted') } |
| 675 | failure { collectArtifacts('failed') } |
| 676 | always { collectArtifacts('always') } |
| 677 | } |
| 678 | } // pipeline |
| 679 | |
| 680 | // EOF |