blob: 98c9beb62f365dcfe8973a6984abe97ebb9328de [file] [log] [blame]
Joey Armstrong8c6f6482023-01-12 12:31:44 -05001// Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo42f6e572021-01-25 15:11:34 -08002//
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
Hardik Windlassec9341b2021-06-07 11:58:29 +000015// voltha-2.x e2e tests for openonu-go
Matteo Scandolo42f6e572021-01-25 15:11:34 -080016// uses bbsim to simulate OLT/ONUs
17
Joey Armstronge5aae1c2023-07-24 14:11:20 -040018// [TODO] Update syntax below to the latest supported
Matteo Scandoloa156b572021-02-04 11:52:18 -080019library identifier: 'cord-jenkins-libraries@master',
20 retriever: modernSCM([
21 $class: 'GitSCMSource',
22 remote: 'https://gerrit.opencord.org/ci-management.git'
23])
24
Joey Armstronge5aae1c2023-07-24 14:11:20 -040025//------------------//
26//---] GLOBAL [---//
27//------------------//
Hardik Windlassec9341b2021-06-07 11:58:29 +000028def clusterName = "kind-ci"
Joey Armstronge5aae1c2023-07-24 14:11:20 -040029String branch_name = 'master'
Hardik Windlassec9341b2021-06-07 11:58:29 +000030
Joey Armstronge5aae1c2023-07-24 14:11:20 -040031// -----------------------------------------------------------------------
32// Intent: Determine if working on a release branch.
33// Note: Conditional is legacy, should also check for *-dev or *-pre
34// -----------------------------------------------------------------------
35Boolean isReleaseBranch(String name)
36{
37 // List modifiers = ['-dev', '-pre', 'voltha-x.y.z-pre']
38 // if branch_name in modifiers
39 return(name != 'master') // OR branch_name.contains('-')
40}
41
42// -----------------------------------------------------------------------
43// Intent:
44// -----------------------------------------------------------------------
Joey Armstrong2d5a7c12023-04-13 09:37:42 -040045def execute_test(testTarget, workflow, testLogging, teardown, testSpecificHelmFlags = "")
46{
Joey Armstrong8c6f6482023-01-12 12:31:44 -050047 def infraNamespace = "default"
48 def volthaNamespace = "voltha"
49 def logsDir = "$WORKSPACE/${testTarget}"
Joey Armstrong293e16b2022-11-26 20:16:33 -050050
51 stage('IAM')
52 {
Joey Armstrong84adc542023-04-11 14:47:34 -040053 script
54 {
55 String iam = [
56 'ci-management',
57 'jjb',
58 'pipeline',
59 'voltha',
Joey Armstronge5aae1c2023-07-24 14:11:20 -040060 branch_name,
Joey Armstrong84adc542023-04-11 14:47:34 -040061 'bbsim-tests.groovy'
62 ].join('/')
Joey Armstronge5aae1c2023-07-24 14:11:20 -040063 println("${iam}: ENTER")
64 println("${iam}: LEAVE")
Joey Armstrong84adc542023-04-11 14:47:34 -040065 }
Joey Armstrong293e16b2022-11-26 20:16:33 -050066 }
67
68 stage('Cleanup') {
Joey Armstrong84adc542023-04-11 14:47:34 -040069 if (teardown) {
70 timeout(15) {
71 script {
72 helmTeardown(["default", infraNamespace, volthaNamespace])
73 }
74 timeout(1) {
75 sh returnStdout: false, script: '''
Hardik Windlassec9341b2021-06-07 11:58:29 +000076 # remove orphaned port-forward from different namespaces
Joey Armstronge5aae1c2023-07-24 14:11:20 -040077 ps aux | grep port-forw | grep -v grep | awk '{print $2}' | xargs --no-run-if-empty kill -9
Hardik Windlassec9341b2021-06-07 11:58:29 +000078 '''
Joey Armstrong84adc542023-04-11 14:47:34 -040079 }
80 }
81 }
Hardik Windlassec9341b2021-06-07 11:58:29 +000082 }
Joey Armstrong8c6f6482023-01-12 12:31:44 -050083
84 stage ('Initialize')
85 {
Joey Armstrong84adc542023-04-11 14:47:34 -040086 // VOL-4926 - Is voltha-system-tests available ?
87 String cmd = [
88 'make',
89 '-C', "$WORKSPACE/voltha-system-tests",
90 "KAIL_PATH=\"$WORKSPACE/bin\"",
91 'kail',
92 ].join(' ')
93 println(" ** Running: ${cmd}:\n")
Joey Armstrongbeef4cd2023-01-18 09:59:58 -050094 sh("${cmd}")
Joey Armstrong8c6f6482023-01-12 12:31:44 -050095 }
96
97 stage('Deploy common infrastructure') {
Joey Armstrong84adc542023-04-11 14:47:34 -040098 sh '''
Hardik Windlasse1660492022-03-14 15:12:46 +000099 helm repo add onf https://charts.opencord.org
100 helm repo update
101 if [ ${withMonitoring} = true ] ; then
102 helm install nem-monitoring onf/nem-monitoring \
103 --set prometheus.alertmanager.enabled=false,prometheus.pushgateway.enabled=false \
104 --set kpi_exporter.enabled=false,dashboards.xos=false,dashboards.onos=false,dashboards.aaa=false,dashboards.voltha=false
105 fi
106 '''
Joey Armstrong8c6f6482023-01-12 12:31:44 -0500107 }
108
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400109 stage('Deploy Voltha')
110 {
111 if (teardown)
112 {
113 timeout(10)
114 {
115 script
116 {
Hardik Windlassec9341b2021-06-07 11:58:29 +0000117 sh """
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700118 mkdir -p ${logsDir}
119 _TAG=kail-startup kail -n ${infraNamespace} -n ${volthaNamespace} > ${logsDir}/onos-voltha-startup-combined.log &
Hardik Windlassec9341b2021-06-07 11:58:29 +0000120 """
121
122 // if we're downloading a voltha-helm-charts patch, then install from a local copy of the charts
123 def localCharts = false
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400124
125 if (volthaHelmChartsChange != ""
126 || gerritProject == "voltha-helm-charts"
127 || isReleaseBranch(branch) // branch != 'master'
128 ) {
Hardik Windlassec9341b2021-06-07 11:58:29 +0000129 localCharts = true
130 }
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400131 Boolean is_release = isReleaseBranch(branch)
132 println(" ** localCharts=${localCharts}, branch_name=${branch_name}, isReleaseBranch=${is_release}")
Hardik Windlassec9341b2021-06-07 11:58:29 +0000133
134 // NOTE temporary workaround expose ONOS node ports
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400135 def localHelmFlags = extraHelmFlags.trim()
136 + " --set global.log_level=${logLevel.toUpperCase()} "
137 + " --set onos-classic.onosSshPort=30115 "
138 + " --set onos-classic.onosApiPort=30120 "
139 + " --set onos-classic.onosOfPort=31653 "
140 + " --set onos-classic.individualOpenFlowNodePorts=true "
141 + testSpecificHelmFlags
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800142
Hardik Windlassec9341b2021-06-07 11:58:29 +0000143 if (gerritProject != "") {
144 localHelmFlags = "${localHelmFlags} " + getVolthaImageFlags("${gerritProject}")
145 }
146
147 volthaDeploy([
148 infraNamespace: infraNamespace,
149 volthaNamespace: volthaNamespace,
150 workflow: workflow.toLowerCase(),
Hardik Windlass2b164342022-02-28 03:50:48 +0000151 withMacLearning: enableMacLearning.toBoolean(),
Hardik Windlassec9341b2021-06-07 11:58:29 +0000152 extraHelmFlags: localHelmFlags,
153 localCharts: localCharts,
154 bbsimReplica: olts.toInteger(),
155 dockerRegistry: registry,
156 ])
Matteo Scandolod17de3a2021-04-09 15:47:52 -0700157 }
Matteo Scandolofcfc60d2021-02-24 09:06:48 -0800158
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400159 // -----------------------------------------------------------------------
160 // Intent: Replacing P_IDS with pgrep/pkill is a step forward.
161 // Why not simply use a pid file, capture _TAG=kail-startup above
162 // Grep runs the risk of terminating stray commands (??-good <=> bad-??)
163 // -----------------------------------------------------------------------
164 println('Try out the pgrep/pkill commands')
165 def stream = sh(
166 returnStatus:false,
167 returnStdout:true,
168 script: '''pgrep --list-full kail-startup || true'''
169 )
170 println("** pgrep output: ${stream}")
171
172 // -----------------------------------------------------------------------
173 // stop logging
174 // -----------------------------------------------------------------------
Matteo Scandolod17de3a2021-04-09 15:47:52 -0700175 sh """
Hardik Windlassec9341b2021-06-07 11:58:29 +0000176 P_IDS="\$(ps e -ww -A | grep "_TAG=kail-startup" | grep -v grep | awk '{print \$1}')"
177 if [ -n "\$P_IDS" ]; then
178 echo \$P_IDS
179 for P_ID in \$P_IDS; do
180 kill -9 \$P_ID
181 done
182 fi
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700183 cd ${logsDir}
Hardik Windlassec9341b2021-06-07 11:58:29 +0000184 gzip -k onos-voltha-startup-combined.log
185 rm onos-voltha-startup-combined.log
Matteo Scandolod17de3a2021-04-09 15:47:52 -0700186 """
Hardik Windlassec9341b2021-06-07 11:58:29 +0000187 }
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400188
189 sh """
Hardik Windlassec9341b2021-06-07 11:58:29 +0000190 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"&
191 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"&
192 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"&
193 bbsimDmiPortFwd=50075
194 for i in {0..${olts.toInteger() - 1}}; do
195 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"&
196 ((bbsimDmiPortFwd++))
197 done
Hardik Windlass3bb089a2022-03-22 17:56:03 +0000198 if [ ${withMonitoring} = true ] ; then
199 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"&
200 fi
Hardik Windlassec9341b2021-06-07 11:58:29 +0000201 ps aux | grep port-forward
202 """
Joey Armstrong8c6f6482023-01-12 12:31:44 -0500203
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400204 // setting ONOS log level
205 script
206 {
207 setOnosLogLevels([
208 onosNamespace: infraNamespace,
209 apps: [
210 'org.opencord.dhcpl2relay',
211 'org.opencord.olt',
212 'org.opencord.aaa',
213 'org.opencord.maclearner',
214 'org.onosproject.net.flowobjective.impl.FlowObjectiveManager',
215 'org.onosproject.net.flowobjective.impl.InOrderFlowObjectiveManager'
216 ],
217 logLevel: logLevel
218 ])
219 } // script
220 } // if (teardown)
221 } // stage('Deploy Voltha')
222
223 stage('Run test ' + testTarget + ' on ' + workflow + ' workFlow')
224 {
225 sh """
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000226 if [ ${withMonitoring} = true ] ; then
Joey Armstrong8c6f6482023-01-12 12:31:44 -0500227 mkdir -p "$WORKSPACE/voltha-pods-mem-consumption-${workflow}"
228 cd "$WORKSPACE/voltha-system-tests"
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400229 make venv-activate-script
230 set +u && source .venv/bin/activate && set -u
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000231 # Collect initial memory consumption
Joey Armstrong0eb8bd82023-07-10 13:26:25 -0400232 python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace}
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000233 fi
Hardik Windlasse1660492022-03-14 15:12:46 +0000234 """
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400235
236 sh """
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700237 mkdir -p ${logsDir}
Hardik Windlassd62442d2021-11-30 10:51:20 +0000238 export ROBOT_MISC_ARGS="-d ${logsDir} ${params.extraRobotArgs} "
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700239 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}"
Hardik Windlass72947302021-06-14 10:36:57 +0000240 export KVSTOREPREFIX=voltha/voltha_voltha
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800241
Joey Armstrong0eb8bd82023-07-10 13:26:25 -0400242 make -C "$WORKSPACE/voltha-system-tests" ${testTarget}
Hardik Windlass72947302021-06-14 10:36:57 +0000243 """
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400244
245 getPodsInfo("${logsDir}")
246
247 sh """
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400248 # set +e
Hardik Windlassdad8e5c2021-11-11 05:19:47 +0000249 # collect logs collected in the Robot Framework StartLogging keyword
250 cd ${logsDir}
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400251 gzip *-combined.log
252 rm -f *-combined.log
Hardik Windlassdad8e5c2021-11-11 05:19:47 +0000253 """
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400254
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000255 sh """
256 if [ ${withMonitoring} = true ] ; then
Joey Armstrong8c6f6482023-01-12 12:31:44 -0500257 cd "$WORKSPACE/voltha-system-tests"
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400258 make venv-activate-script
259 set +u && source .venv/bin/activate && set -u
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000260 # Collect memory consumption of voltha pods once all the tests are complete
Joey Armstrong0eb8bd82023-07-10 13:26:25 -0400261 python scripts/mem_consumption.py -o $WORKSPACE/voltha-pods-mem-consumption-${workflow} -a 0.0.0.0:31301 -n ${volthaNamespace}
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000262 fi
263 """
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400264 } // stage
265} // execute_test()
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800266
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400267// -----------------------------------------------------------------------
268// -----------------------------------------------------------------------
269def collectArtifacts(exitStatus)
270{
Hardik Windlassec9341b2021-06-07 11:58:29 +0000271 getPodsInfo("$WORKSPACE/${exitStatus}")
272 sh """
Joey Armstrong0eb8bd82023-07-10 13:26:25 -0400273 kubectl logs -n voltha -l app.kubernetes.io/part-of=voltha > $WORKSPACE/${exitStatus}/voltha.log
Hardik Windlassec9341b2021-06-07 11:58:29 +0000274 """
Hardik Windlass8cd517c2022-03-22 04:01:40 +0000275 archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.txt,**/*.html,**/voltha-pods-mem-consumption-att/*,**/voltha-pods-mem-consumption-dt/*,**/voltha-pods-mem-consumption-tt/*'
Hardik Windlassec9341b2021-06-07 11:58:29 +0000276 sh '''
277 sync
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400278 [[ $(pgrep --count kail) -gt 0 ]] && pkill --echo kail
Hardik Windlassec9341b2021-06-07 11:58:29 +0000279 which voltctl
280 md5sum $(which voltctl)
281 '''
282 step([$class: 'RobotPublisher',
283 disableArchiveOutput: false,
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700284 logFileName: "**/*/log*.html",
Hardik Windlassec9341b2021-06-07 11:58:29 +0000285 otherFiles: '',
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700286 outputFileName: "**/*/output*.xml",
Hardik Windlassec9341b2021-06-07 11:58:29 +0000287 outputPath: '.',
288 passThreshold: 100,
Matteo Scandolo9c230bb2021-10-22 12:48:39 -0700289 reportFileName: "**/*/report*.html",
Andrea Campanellaabc09772021-06-16 12:08:57 +0200290 unstableThreshold: 0,
291 onlyCritical: true]);
Hardik Windlassec9341b2021-06-07 11:58:29 +0000292}
293
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800294pipeline {
295
296 /* no label, executor is determined by JJB */
297 agent {
298 label "${params.buildNode}"
299 }
300 options {
Hardik Windlassec9341b2021-06-07 11:58:29 +0000301 timeout(time: "${timeout}", unit: 'MINUTES')
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800302 }
303 environment {
Hardik Windlassec9341b2021-06-07 11:58:29 +0000304 KUBECONFIG="$HOME/.kube/kind-${clusterName}"
305 VOLTCONFIG="$HOME/.volt/config"
306 PATH="$PATH:$WORKSPACE/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Hardik Windlassec9341b2021-06-07 11:58:29 +0000307 DIAGS_PROFILE="VOLTHA_PROFILE"
Matteo Scandolo35ac7822021-10-28 18:08:54 -0700308 SSHPASS="karaf"
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800309 }
Hardik Windlassec9341b2021-06-07 11:58:29 +0000310 stages {
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800311 stage('Download Code') {
312 steps {
313 getVolthaCode([
314 branch: "${branch}",
315 gerritProject: "${gerritProject}",
316 gerritRefspec: "${gerritRefspec}",
317 volthaSystemTestsChange: "${volthaSystemTestsChange}",
318 volthaHelmChartsChange: "${volthaHelmChartsChange}",
319 ])
320 }
321 }
Joey Armstrong84adc542023-04-11 14:47:34 -0400322
323 stage('Build patch v1.1')
324 {
325 // build the patch only if gerritProject is specified
326 when
327 {
328 expression
329 {
330 return !gerritProject.isEmpty()
331 }
Hardik Windlassec9341b2021-06-07 11:58:29 +0000332 }
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800333 steps {
334 // NOTE that the correct patch has already been checked out
335 // during the getVolthaCode step
336 buildVolthaComponent("${gerritProject}")
337 }
338 }
Joey Armstronged161f72023-04-11 13:16:59 -0400339
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400340 stage('Create K8s Cluster')
341 {
Joey Armstrongbf492922023-04-13 17:05:09 -0400342 steps
Joey Armstrong84adc542023-04-11 14:47:34 -0400343 {
Joey Armstrongbf492922023-04-13 17:05:09 -0400344 script
Joey Armstrong84adc542023-04-11 14:47:34 -0400345 {
Joey Armstrongbf492922023-04-13 17:05:09 -0400346 println(' ** Calling installKind.groovy: ENTER')
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400347 // chicken-n-egg problem, kind command needed
348 // to determine if kubernetes cluster is active
Joey Armstrong41feb7c2023-04-14 11:28:04 -0400349 installKind() { debug:true }
Joey Armstrongbf492922023-04-13 17:05:09 -0400350 println(' ** Calling installKind.groovy: LEAVE')
Joey Armstrong84adc542023-04-11 14:47:34 -0400351
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400352 def clusterExists = sh(
Joey Armstrongbf492922023-04-13 17:05:09 -0400353 returnStdout: true,
Joey Armstronge5aae1c2023-07-24 14:11:20 -0400354 script: """kind get clusters | grep "${clusterName}" | wc -l""")
Joey Armstrongbf492922023-04-13 17:05:09 -0400355
356 if (clusterExists.trim() == "0")
357 {
358 createKubernetesCluster([nodes: 3, name: clusterName])
359 }
360 } // script
361 } // steps
362 } // stage('Create K8s Cluster')
Joey Armstrong84adc542023-04-11 14:47:34 -0400363
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400364 stage('Replace voltctl')
365 {
366 // if the project is voltctl override the downloaded one with the built one
367 when {
368 expression {
369 return gerritProject == "voltctl"
370 }
371 }
372
373 steps
374 {
375 sh """
Joey Armstrong93c82732023-02-07 03:01:25 -0500376 # [TODO] - why is this platform specific (?)
377 # [TODO] - revisit, command alteration has masked an error (see: voltha-2.11).
378 # find will fail when no filsystem matches are found.
379 # mv(ls) succeded simply by accident/invoked at a different time.
Hardik Windlassc6ba23e2021-06-08 08:19:52 +0000380 mv `ls $WORKSPACE/voltctl/release/voltctl-*-linux-amd*` $WORKSPACE/bin/voltctl
381 chmod +x $WORKSPACE/bin/voltctl
382 """
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400383 } // steps
384 } // stage
Hardik Windlassec9341b2021-06-07 11:58:29 +0000385
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400386 stage('Load image in kind nodes')
387 {
388 when {
389 expression {
390 return !gerritProject.isEmpty()
391 }
Hardik Windlassec9341b2021-06-07 11:58:29 +0000392 }
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400393 steps {
394 loadToKind()
395 }
Matteo Scandolo29597f02021-02-12 10:53:57 -0800396 }
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400397
398 stage('Parse and execute tests')
399 {
400 steps {
401 script {
402 def tests = readYaml text: testTargets
403
404 for(int i = 0;i<tests.size();i++) {
405 def test = tests[i]
406 def target = test["target"]
407 def workflow = test["workflow"]
408 def flags = test["flags"]
409 def teardown = test["teardown"].toBoolean()
410 def logging = test["logging"].toBoolean()
411 def testLogging = 'False'
412 if (logging) {
413 testLogging = 'True'
414 }
415 println "Executing test ${target} on workflow ${workflow} with logging ${testLogging} and extra flags ${flags}"
416 execute_test(target, workflow, testLogging, teardown, flags)
417 }
418 }
419 }
420 } // stage
421 } // stages
Joey Armstrong84adc542023-04-11 14:47:34 -0400422
423 post
424 {
425 aborted { collectArtifacts('aborted') }
426 failure { collectArtifacts('failed') }
Joey Armstrongbf492922023-04-13 17:05:09 -0400427 always { collectArtifacts('always') }
Matteo Scandolo42f6e572021-01-25 15:11:34 -0800428 }
Joey Armstrong2d5a7c12023-04-13 09:37:42 -0400429} // pipeline
Joey Armstronged161f72023-04-11 13:16:59 -0400430
431// EOF