jjb: integration: fix ust lower-urcu for deb12
[lttng-ci.git] / pipelines / integration / ust-2.12-lower-urcu_testsuite.groovy
1 #!groovy
2
3 // SPDX-FileCopyrightText: 2021 Michael Jeanson <mjeanson@efficios.com>
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6
7 pipeline {
8 agent none
9
10 /* Global options for the pipeline */
11 options {
12 preserveStashes()
13 buildDiscarder(logRotator(numToKeepStr: '5'))
14 timeout(time: 2, unit: 'HOURS')
15 disableConcurrentBuilds()
16 timestamps()
17 skipDefaultCheckout()
18 }
19
20 triggers {
21 pollSCM('@hourly')
22 }
23
24 /* Top level sequential stages */
25 stages {
26
27 /* First level stage */
28 stage('Prepare targets') {
29 agent { label 'deb12-amd64' }
30
31 stages {
32 stage('Checkout sources') {
33 steps {
34 cleanWs()
35
36 dir("src/ust/stable-2.12-lower-urcu-dep") {
37 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12-lower-urcu-dep']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.efficios.com/deliverable/lttng-ust.git']]])
38 }
39 dir("src/ust/stable-2.13") {
40 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-ust']]])
41 }
42
43 dir("src/urcu/stable-0.9") {
44 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.9']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/userspace-rcu']]])
45 }
46 dir("src/urcu/stable-0.12") {
47 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/urcu/userspace-rcu']]])
48 }
49
50 dir("src/babeltrace/stable-2.0") {
51 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.0']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/efficios/babeltrace']]])
52 }
53 }
54 }
55
56 stage('Generate UST 2.12 targets') {
57 environment {
58 TARGETS = "${WORKSPACE}/targets"
59 CUR_TARGET = "current"
60 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
61 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
62 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
63 }
64
65 steps {
66 /* Create empty include dir to make gcc '-Wmissing-include-dirs' happy */
67 sh "mkdir -p \"${TARGETS}/${CUR_TARGET}/include\""
68
69 // Build babeltrace 2.0
70 dir("src/babeltrace/stable-2.0") {
71 sh "./bootstrap"
72 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
73 sh "make -j\"\$(nproc)\" V=1"
74 sh "make check"
75 sh "make install"
76 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
77 }
78
79 // Add symlink from babeltrace2 to babeltrace
80 dir("${TARGETS}/${CUR_TARGET}/bin") {
81 sh "ln -s babeltrace2 babeltrace"
82 }
83
84 // Build liburcu 0.9 for ust 2.12
85 dir("src/urcu/stable-0.9") {
86 sh "./bootstrap"
87 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
88 sh "make -j\"\$(nproc)\" V=1"
89 sh "make check"
90 sh "make install"
91 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
92 }
93
94 // Build ust 2.12 against liburcu 0.9
95 dir("src/ust/stable-2.12-lower-urcu-dep") {
96 sh "./bootstrap"
97 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-python-agent --enable-java-agent-all --enable-jni-interface"
98 sh "make -j\"\$(nproc)\" V=1"
99 sh "make check"
100 sh "make install"
101 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
102 }
103
104 // Make a copy of the ust 2.12 target with only urcu 0.9
105 dir("${TARGETS}") {
106 sh "cp -dpr \"${CUR_TARGET}\" \"ust-2.12-urcu-0.9\""
107 }
108
109 // Remove the 'dev' part of liburcu 0.9, keep only the versionned SO
110 dir("${TARGETS}/${CUR_TARGET}") {
111 sh "rm -rf \"${TARGETS}/${CUR_TARGET}/include/urcu\""
112 sh "rm -f \"${TARGETS}/${CUR_TARGET}/include/\"urcu*.h"
113 sh "rm -f \"${TARGETS}/${CUR_TARGET}/lib/\"liburcu*.so"
114 sh "rm -f \"${TARGETS}/${CUR_TARGET}/lib/pkgconfig/\"liburcu*"
115 }
116
117 // Build liburcu 0.12 for tools 2.12
118 dir("src/urcu/stable-0.12") {
119 sh "./bootstrap"
120 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --disable-static"
121 sh "make -j\"\$(nproc)\" V=1"
122 sh "make check"
123 sh "make install"
124 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
125 }
126
127 // Copy the liburcu 0.12 runtime SO to the ust-2.12-urcu-0.9 target
128 sh "cp -dpr \"${TARGETS}/${CUR_TARGET}/lib/\"liburcu*.so.6* \"${TARGETS}/ust-2.12-urcu-0.9/lib\""
129
130 dir("${TARGETS}") {
131 // Archive the first ust 2.12 target with urcu 0.9 dev+runtime and 0.12 runtime
132 stash name: "ust-2.12-urcu-0.9", includes: 'ust-2.12-urcu-0.9/**'
133 archiveArtifacts artifacts: 'ust-2.12-urcu-0.9/**', fingerprint: false
134
135 // Archive the second ust 2.12 target with urcu 0.9 runtime and 0.12 dev+runtime
136 sh 'mv "${CUR_TARGET}" "ust-2.12-urcu-0.12"'
137 stash name: "ust-2.12-urcu-0.12", includes: 'ust-2.12-urcu-0.12/**'
138 archiveArtifacts artifacts: 'ust-2.12-urcu-0.12/**', fingerprint: false
139 }
140 }
141 }
142
143 stage('Generate UST 2.13 target') {
144 environment {
145 TARGETS = "${WORKSPACE}/targets"
146 CUR_TARGET = "current"
147 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
148 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
149 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
150 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
151 }
152
153 steps {
154 // Create empty include dir to make gcc '-Wmissing-include-dirs' happy
155 sh "mkdir -p \"${TARGETS}/${CUR_TARGET}/include\""
156
157 // Install babeltrace 2.0 built in the previous stage in a fresh target
158 dir("src/babeltrace/stable-2.0") {
159 sh "make install"
160 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
161 }
162
163 // Add symlink from babeltrace2 to babeltrace
164 dir("${TARGETS}/${CUR_TARGET}/bin") {
165 sh "ln -s babeltrace2 babeltrace"
166 }
167
168 // Install liburcu 0.12 built in the previous stage in a fresh target
169 dir("src/urcu/stable-0.12") {
170 sh "make install"
171 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
172 }
173
174 // Build ust 2.13 against liburcu 0.12
175 dir("src/ust/stable-2.13") {
176 sh "./bootstrap"
177 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-python-agent --enable-java-agent-all --enable-jni-interface"
178 sh "make -j\"\$(nproc)\" V=1"
179 sh "make check"
180 sh "make install"
181 sh "find \"${TARGETS}/${CUR_TARGET}\" -name \"*.la\" -delete"
182 }
183
184 // Archive the target
185 dir("${TARGETS}") {
186 sh 'mv "${CUR_TARGET}" "ust-2.13"'
187 stash name: "ust-2.13", includes: "ust-2.13/**"
188 archiveArtifacts artifacts: 'ust-2.13/**', fingerprint: false
189 }
190 }
191 }
192 }
193 }
194
195 /* First level stage */
196 stage('Test tools 2.12 / 2.13 in parallel') {
197 parallel {
198 // Parallel stage for tools 2.12
199 stage('Test tools 2.12') {
200 agent { label 'deb12-amd64' }
201
202 environment {
203 TARGETS = "${WORKSPACE}/targets"
204 CUR_TARGET = "current"
205 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
206 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
207 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
208 CLASSPATH = "/usr/share/java/log4j-1.2.jar:${TARGETS}/${CUR_TARGET}/share/java/*"
209 PYTHONPATH = "${TARGETS}/${CUR_TARGET}/lib/python2.7/site-packages"
210 LD_LIBRARY_PATH = "${TARGETS}/${CUR_TARGET}/lib"
211 PATH = "$PATH:${TARGETS}/${CUR_TARGET}/bin"
212 }
213
214 stages {
215 stage('Checkout tools 2.12 sources') {
216 steps {
217 cleanWs()
218
219 dir("src/tools/stable-2.12") {
220 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-tools']]])
221 }
222 }
223 }
224
225 stage('Unstash targets') {
226 steps {
227 dir("${TARGETS}") {
228 unstash name: "ust-2.12-urcu-0.9"
229 unstash name: "ust-2.12-urcu-0.12"
230 }
231 }
232 }
233
234 stage('Build tools 2.12') {
235 steps {
236 // Restore the ust-2.12 target with urcu 0.12
237 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.12\" \"${TARGETS}/${CUR_TARGET}\""
238
239 // Build tools 2.12
240 // --disable-dependency-tracking is important to allow rebuilding only the testapps
241 dir("src/tools/stable-2.12") {
242 sh "./bootstrap"
243 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking"
244 sh "make -j\"\$(nproc)\" V=1"
245 }
246
247 // Swap the target to ust 2.12 with urcu 0.9
248 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
249 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.9\" \"${TARGETS}/${CUR_TARGET}\""
250
251 // Rebuild the testapps with ust 2.12 urcu 0.9
252 dir("src/tools/stable-2.12/tests") {
253 sh '''
254 for dir in utils/testapp regression/tools/filtering regression/ust; do
255 cd $dir
256 make clean
257 make -j"$(nproc)" V=1
258 cd -
259 done'''
260 }
261
262 // Swap back the target to ust 2.12 with urcu 0.12
263 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
264 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.12\" \"${TARGETS}/${CUR_TARGET}\""
265
266 }
267 }
268
269 stage('Run tools 2.12 tests') {
270 options {
271 timeout(time: 15, unit: 'MINUTES', activity: true)
272 }
273
274 steps {
275 // Run the tests
276 dir("src/tools/stable-2.12") {
277 /*
278 * This will mark the stage as FAILED if the test suite is not
279 * successful but will continue the execution of the steps.
280 */
281 catchError {
282 sh "make --keep-going check"
283 }
284 }
285 }
286
287 post {
288 always {
289 dir("src/tools/stable-2.12") {
290 sh 'mkdir -p "${WORKSPACE}/tap/ust-2.12"'
291 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "${WORKSPACE}/tap/ust-2.12"'
292
293 sh 'mkdir -p "${WORKSPACE}/log/ust-2.12"'
294 sh 'rsync -a --include "test-suite.log" --include \'*/\' --exclude=\'*\' tests/ "${WORKSPACE}/log/ust-2.12"'
295 }
296 }
297
298 cleanup {
299 // Clean target
300 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
301 }
302 }
303 }
304 }
305
306 post {
307 always {
308 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-212")]
309 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
310 archiveArtifacts artifacts: 'tap/**,log/**', fingerprint: false
311 }
312 cleanup {
313 cleanWs cleanWhenFailure: false
314 }
315 }
316 }
317
318 // Parallel stage for tools 2.13
319 stage('Test tools 2.13') {
320 agent { label 'deb12-amd64' }
321
322 environment {
323 TARGETS = "${WORKSPACE}/targets"
324 CUR_TARGET = "current"
325 CPPFLAGS = "-I${TARGETS}/${CUR_TARGET}/include"
326 LDFLAGS = "-L${TARGETS}/${CUR_TARGET}/lib"
327 PKG_CONFIG_PATH = "${TARGETS}/${CUR_TARGET}/lib/pkgconfig"
328 CLASSPATH = "/usr/share/java/log4j-1.2.jar:${TARGETS}/${CUR_TARGET}/share/java/*"
329 PYTHONPATH =" ${TARGETS}/${CUR_TARGET}/lib/python2.7/site-packages"
330 LD_LIBRARY_PATH = "${TARGETS}/${CUR_TARGET}/lib"
331 PATH = "$PATH:${TARGETS}/${CUR_TARGET}/bin"
332 }
333
334 stages {
335 stage('Checkout tools 2.13 sources') {
336 steps {
337 cleanWs()
338
339 dir("src/tools/stable-2.13") {
340 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/lttng-tools']]])
341 }
342 }
343 }
344
345 stage('Unstash targets') {
346 steps {
347 dir("${TARGETS}") {
348 unstash name: "ust-2.12-urcu-0.9"
349 unstash name: "ust-2.13"
350 }
351 }
352 }
353
354 stage('Build tools 2.13') {
355 steps {
356 // Restore the ust-2.13 target
357 sh 'ln -sf "${TARGETS}/ust-2.13" "${TARGETS}/${CUR_TARGET}"'
358
359 // Disable regression tests that don't apply to ust 2.12
360 dir("src/tools/stable-2.13/tests/regression") {
361 sh '''
362 sed -i '/tools\\/notification\\/test_notification_ust_error/d' Makefile.am
363 sed -i '/tools\\/notification\\/test_notification_ust_capture/d' Makefile.am
364 sed -i '/tools\\/notification\\/test_notification_ust_event_rule_condition_exclusion/d' Makefile.am
365 sed -i '/tools\\/notification\\/test_notification_kernel_error/d' Makefile.am
366 sed -i '/tools\\/notification\\/test_notification_kernel_capture/d' Makefile.am
367 sed -i '/tools\\/notification\\/test_notification_kernel_instrumentation/d' Makefile.am
368 sed -i '/tools\\/notification\\/test_notification_kernel_syscall/d' Makefile.am
369 sed -i '/tools\\/notification\\/test_notification_notifier_discarded_count/d' Makefile.am
370 sed -i '/tools\\/notification\\/test_notification_kernel_userspace_probe/d' Makefile.am
371 sed -i '/tools\\/tracker\\/test_event_tracker/d' Makefile.am
372 sed -i '/tools\\/trigger\\/start-stop\\/test_start_stop/d' Makefile.am
373 sed -i '/tools\\/trigger\\/test_add_trigger_cli/d' Makefile.am
374 sed -i '/tools\\/trigger\\/test_list_triggers_cli/d' Makefile.am
375 sed -i '/tools\\/trigger\\/test_remove_trigger_cli/d' Makefile.am
376 sed -i '/tools\\/trigger\\/name\\/test_trigger_name_backwards_compat/d' Makefile.am
377 sed -i '/tools\\/trigger\\/rate-policy\\/test_ust_rate_policy/d' Makefile.am
378
379 sed -i 's/\\(tools\\/clear\\/test_kernel\\) \\\\/\\1/' Makefile.am
380 sed -i 's/\\(tools\\/relayd-grouping\\/test_ust\\) \\\\/\\1/' Makefile.am
381 '''
382 }
383
384 // Build tools 2.13 with ust 2.13
385 // --disable-dependency-tracking is important to allow rebuilding only the testapps with ust 2.12
386 dir("src/tools/stable-2.13") {
387 sh "./bootstrap"
388 sh "./configure --prefix=\"${TARGETS}/${CUR_TARGET}\" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking"
389 sh "make -j\"\$(nproc)\" V=1"
390 }
391
392 // Swap the target to ust 2.12
393 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
394 sh "ln -sf \"${TARGETS}/ust-2.12-urcu-0.9\" \"${TARGETS}/${CUR_TARGET}\""
395
396 // Rebuild the testapps with ust 2.12
397 dir("src/tools/stable-2.13/tests") {
398 sh '''
399 for dir in utils/testapp regression/tools/filtering regression/ust; do
400 cd $dir
401 find . -name Makefile | xargs sed -i "s/-llttng-ust-common//"
402 make clean
403 make -j"$(nproc)" V=1
404 cd -
405 done'''
406 }
407
408 // Add the ust 2.13 runtime to the target
409 sh "cp -dp \"${TARGETS}/ust-2.13/lib/\"liblttng-ust-*.so.1* \"${TARGETS}/${CUR_TARGET}/lib/\""
410 sh "cp -dp \"${TARGETS}/ust-2.13/lib/\"liblttng-ust-ctl.so.5* \"${TARGETS}/${CUR_TARGET}/lib/\""
411 }
412 }
413
414 stage('Run tools 2.13 tests') {
415 options {
416 timeout(time: 15, unit: 'MINUTES', activity: true)
417 }
418
419 steps {
420 // Run the regression tests
421 dir("src/tools/stable-2.13/tests/regression") {
422 /*
423 * This will mark the stage as FAILED if the test suite is not
424 * successful but will continue the execution of the steps.
425 */
426 catchError {
427 sh "make --keep-going check"
428 }
429 }
430 }
431
432 post {
433 always {
434 dir("src/tools/stable-2.13") {
435 sh 'mkdir -p "${WORKSPACE}/tap/ust-2.13"'
436 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "${WORKSPACE}/tap/ust-2.13"'
437
438 sh 'mkdir -p "${WORKSPACE}/log/ust-2.13"'
439 sh 'rsync -a --include "test-suite.log" --include \'*/\' --exclude=\'*\' tests/ "${WORKSPACE}/log/ust-2.13"'
440 }
441 }
442
443 cleanup {
444 // Clean target
445 sh "rm -f \"${TARGETS}/${CUR_TARGET}\""
446 }
447 }
448 }
449 }
450
451 post {
452 always {
453 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-213")]
454 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
455 archiveArtifacts artifacts: 'tap/**,log/**', fingerprint: false
456 }
457
458 cleanup {
459 cleanWs cleanWhenFailure: false
460 }
461 }
462 }
463 }
464 }
465 }
466 }
This page took 0.051744 seconds and 4 git commands to generate.