jjb: Run lttng-ust-java-tests when testing lttng-tools
authorKienan Stewart <kstewart@efficios.com>
Wed, 28 Jun 2023 20:25:36 +0000 (16:25 -0400)
committerKienan Stewart <kstewart@efficios.com>
Tue, 15 Aug 2023 17:51:07 +0000 (13:51 -0400)
Change-Id: I379ec43d87c4a75be7c38b22aa35c4a13cf2bef1

automation/ansible/roles/common-node/vars/Debian.yml
jobs/lttng-tools.yaml
jobs/lttng-ust-java-tests.yaml [deleted file]
scripts/lttng-tools/build.sh
scripts/lttng-ust-java-tests/start-sessiond.sh [deleted file]
scripts/lttng-ust-java-tests/stop-sessiond.sh [deleted file]

index 39c2a3af82fdfe36317697f77d8f9f6a10f6615a..24250ffccccbb816e8d4f504b0bce348ee66868a 100644 (file)
@@ -19,6 +19,7 @@ common_node_packages:
   - libtap-harness-archive-perl
   - libtool-bin
   - lzop
+  - maven
   - openssh-server
   - pbzip2
   - psmisc
index 9175626cecd9a6bd03d57426e362e4fee37c9492..c5e772efe0f6af79c8d01c8712fc0bf673a7ad8d 100644 (file)
               <scm/>
             </io.jenkins.plugins.analysis.core.steps.IssuesRecorder>
 
+      - junit: &lttng-tools_publisher_junit_defaults
+          results: 'src/lttng-ust-java-tests/**/target/failsafe-reports/*.xml'
+          allow-empty-results: true
+
       - archive: &lttng-tools_publisher_archive_defaults
           artifacts: 'build/**,deps/**,tap/**,log/**'
           follow-symlinks: true
 
       - tap: *lttng-tools_publisher_tap_defaults
       - raw: *lttng-tools_publisher_warnings-ng_defaults
+      - junit: *lttng-tools_publisher_junit_defaults
       - archive: *lttng-tools_publisher_archive_defaults
       - workspace-cleanup: *lttng-tools_publisher_workspace-cleanup_defaults
       - raw: *lttng-tools_publisher_proc-cleaner_defaults
diff --git a/jobs/lttng-ust-java-tests.yaml b/jobs/lttng-ust-java-tests.yaml
deleted file mode 100644 (file)
index 375e65a..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-- defaults:
-    name: lttng-ust-java-tests
-    description: |
-      Tests for LTTng-UST's Java agent. Runs the master branch of
-      <a href="https://github.com/lttng/lttng-ust-java-tests">lttng-ust-java-tests</a>
-      against the master branches of UST, lttng-tools, and Babeltrace.
-
-      <p>Job is managed by Jenkins Job Builder.</p>
-
-    project-type: freestyle
-
-    wrappers:
-      - workspace-cleanup
-      - timestamps
-      - ansicolor
-
-    scm:
-      - git:
-          url: https://github.com/{github_user}/{github_name}.git
-          browser: githubweb
-          browser-url: https://github.com/{github_user}/{github_name}
-          branches:
-            - origin/master
-          basedir: lttng-ust-java-tests
-          skip-tag: true
-
-    triggers:
-      - timed: "@daily"
-
-    properties:
-      - build-discarder:
-          num-to-keep: 10
-          artifact-num-to-keep: 2
-      - github:
-          url: https://github.com/{github_user}/{github_name}
-
-
-## Templates
-- job-template:
-    name: lttng-ust-java-tests_{version}_build
-    defaults: lttng-ust-java-tests
-
-    project-type: matrix
-    node: 'master' # Applies only to matrix flyweight task
-    axes:
-      - axis:
-         type: slave
-         name: platform
-         values: '{obj:platforms}'
-      - axis:
-         type: user-defined
-         name: java_version
-         values: '{obj:java_version}'
-
-    wrappers:
-      - workspace-cleanup
-      - timestamps
-      - ansicolor
-      - inject:
-          properties-content: |
-            JAVA_HOME=/usr/lib/jvm/${{java_version}}-amd64
-            LD_LIBRARY_PATH=${{WORKSPACE}}/deps/build/lib
-            PATH=${{WORKSPACE}}/deps/build/bin:${{PATH}}
-            LTTNG_UST_DEBUG=1
-            LTTNG_CONSUMERD32_BIN=${{WORKSPACE}}/deps/build/lib/lttng/libexec/lttng-consumerd
-            LTTNG_CONSUMERD64_BIN=${{WORKSPACE}}/deps/build/lib/lttng/libexec/lttng-consumerd
-            LTTNG_SESSION_CONFIG_XSD_PATH=${{WORKSPACE}}/deps/build/share/xml/lttng
-            BABELTRACE_PLUGIN_PATH=$WORKSPACE/deps/build/lib/babeltrace2/plugins
-            LIBBABELTRACE2_PLUGIN_PROVIDER_DIR=$WORKSPACE/deps/build/lib/babeltrace2/plugin-providers
-
-    builders:
-      - copyartifact:
-          project: liburcu_{liburcu_version}_build/platform=${{platform}},conf=std,build=std
-          which-build: last-successful
-          stable: false
-          filter: 'build/**'
-          target: 'deps'
-          do-not-fingerprint: true
-      - copyartifact:
-          project: lttng-ust_{version}_build/liburcu_version={liburcu_version},platform=${{platform}},conf=agents,build=std
-          which-build: last-successful
-          stable: false
-          filter: 'build/**'
-          target: 'deps'
-          do-not-fingerprint: true
-      - copyartifact:
-          project: lttng-tools_{version}_build/babeltrace_version={babeltrace_version},liburcu_version={liburcu_version},platform=${{platform}},conf=agents,build=std
-          which-build: last-successful
-          stable: false
-          filter: 'build/**'
-          target: 'deps'
-          do-not-fingerprint: true
-      - copyartifact:
-          project: babeltrace_{babeltrace_version}_build/platform=${{platform}},conf=std,build=std
-          which-build: last-successful
-          stable: false
-          filter: 'build/**'
-          target: 'deps'
-          do-not-fingerprint: true
-      - shell:
-          !include-raw-escape: scripts/lttng-ust-java-tests/start-sessiond.sh
-      - maven-target:
-          maven-version: "default"
-          goals: "-version"
-          private-repository: true
-      - maven-target:
-          maven-version: "default"
-          goals: clean verify
-          pom: 'lttng-ust-java-tests/pom.xml'
-          properties:
-            - maven.test.failure.ignore=true
-            - common-jar-location=${{WORKSPACE}}/deps/build/share/java/lttng-ust-agent-common.jar
-            - jul-jar-location=${{WORKSPACE}}/deps/build/share/java/lttng-ust-agent-jul.jar
-            - log4j-jar-location=${{WORKSPACE}}/deps/build/share/java/lttng-ust-agent-log4j.jar
-            - log4j2-jar-location=${{WORKSPACE}}/deps/build/share/java/lttng-ust-agent-log4j2.jar
-            - argLine=-Djava.library.path=${{WORKSPACE}}/deps/build/lib
-            - groups={groups}
-      - shell:
-          !include-raw-escape: scripts/lttng-ust-java-tests/stop-sessiond.sh
-
-    publishers:
-      - archive:
-          artifacts: 'lttng-sessiond.log'
-          allow-empty: false
-      - junit:
-          results: 'lttng-ust-java-tests/**/target/failsafe-reports/*.xml'
-      - workspace-cleanup
-      - ircbot: &lttng-ust-java-tests_publisher_ircbot_defaults
-          strategy: statechange-only
-          message-type: summary
-          matrix-notifier: only-parent
-      - email-ext:
-         recipients: '{obj:email_for_all_failure}'
-         always: false
-         unstable: true
-         first-failure: false
-         first-unstable: false
-         not-built: false
-         aborted: false
-         regression: false
-         failure: true
-         second-failure: false
-         improvement: false
-         still-failing: false
-         success: false
-         fixed: false
-         fixed-unhealthy: true
-         still-unstable: false
-         pre-build: false
-         matrix-trigger: only-parent
-         send-to:
-           - recipients
-
-## Project
-- project:
-    name: lttng-ust-java-tests
-    github_user: lttng
-    github_name: lttng-ust-java-tests
-    email_to: 'ci-notification@lists.lttng.org, cc:mathieu.desnoyers@efficios.com'
-    email_for_all_failure: 'mathieu.desnoyers@efficios.com'
-    babeltrace_version: stable-2.0
-    jobs:
-      - 'lttng-ust-java-tests_{version}_build':
-          version: master
-          liburcu_version: master
-          platforms: !!python/tuple [bionic-amd64]
-          java_version: !!python/tuple [java-11-openjdk]
-          groups: '!domain:log4j2' # Remove once the log4j2 domain is merged in master
-      - 'lttng-ust-java-tests_{version}_build':
-          version: stable-2.13
-          liburcu_version: stable-0.13
-          platforms: !!python/tuple [bionic-amd64]
-          java_version: !!python/tuple [java-11-openjdk]
-          groups: '!domain:log4j2'
-      - 'lttng-ust-java-tests_{version}_build':
-          version: stable-2.12
-          liburcu_version: stable-0.13
-          platforms: !!python/tuple [bionic-amd64]
-          java_version: !!python/tuple [java-11-openjdk]
-          groups: '!domain:log4j2'
-
index 6467e11bc2236fc8aeb0002477d5d69914ddb8c7..d1d0d179e5c28fe345ac6d3eba3e81daf019bd72 100755 (executable)
@@ -128,6 +128,7 @@ LTTNG_TOOLS_MAKE_CLEAN="${LTTNG_TOOLS_MAKE_CLEAN:-yes}"
 LTTNG_TOOLS_GEN_COMPILE_COMMANDS="${LTTNG_TOOLS_GEN_COMPILE_COMMANDS:-no}"
 LTTNG_TOOLS_RUN_TESTS="${LTTNG_TOOLS_RUN_TESTS:-yes}"
 LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="${LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION:-no}"
+LTTNG_TOOLS_RUN_UST_JAVA_TESTS="${LTTNG_TOOLS_RUN_UST_JAVA_TESTS:-yes}"
 LTTNG_TOOLS_CLANG_TIDY="${LTTNG_TOOLS_CLANG_TIDY:-no}"
 
 SRCDIR="$WORKSPACE/src/lttng-tools"
@@ -523,7 +524,7 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only)
 
     make --keep-going check || exit_status=1
 
-    # Copy tap logs for the jenkins tap parser before cleaning the build dir
+        # Copy tap logs for the jenkins tap parser before cleaning the build dir
     rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$TAPDIR"
 
     # Copy the test suites top-level log which includes all tests failures
@@ -536,6 +537,46 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only)
         prove --merge -v --exec '' - < long_regression --archive "$TAPDIR/long_regression/" || exit_status=1
         cd ..
     fi
+
+    if [ "$LTTNG_TOOLS_RUN_UST_JAVA_TESTS" = "yes" ] && [ "$conf" = "agents" ] && \
+           [ "$platform" = "bionic-amd64" ] && [ "$LTTNG_TOOLS_MAKE_INSTALL" = "yes" ] ; then
+        print_header "Run lttng-ust-java-tests"
+        # Git Source
+        LTTNG_UST_JAVA_TESTS_GIT_SOURCE="${LTTNG_UST_JAVA_TESTS_GIT_SOURCE:-https://github.com/lttng/lttng-ust-java-tests.git}"
+        LTTNG_UST_JAVA_TESTS_GIT_BRANCH="${LTTNG_UST_JAVA_TESTS_GIT_BRANCH:-master}"
+
+        OWD="$(pwd)"
+        cd ..
+        git clone -b "${LTTNG_UST_JAVA_TESTS_GIT_BRANCH}" "${LTTNG_UST_JAVA_TESTS_GIT_SOURCE}" lttng-ust-java-tests
+        cd lttng-ust-java-tests
+
+        LTTNG_UST_JAVA_TESTS_ENV=(
+            "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/"
+            PATH="${WORKSPACE}/build/bin/:$PATH"
+            LD_LIBRARY_PATH="${WORKSPACE}/build/lib:$LD_LIBRARY_PATH"
+            LTTNG_UST_DEBUG=1
+            LTTNG_CONSUMERD32_BIN="${WORKSPACE}/build/lib/lttng/libexec/lttng-consumerd"
+            LTTNG_CONSUMERD64_BIN="${WORKSPACE}/build/lib/lttng/libexec/lttng-consumerd"
+            LTTNG_SESSION_CONFIG_XSD_PATH="${WORKSPACE}/build/share/xml/lttng"
+            BABELTRACE_PLUGIN_PATH="${WORKSPACE}/deps/build/lib/babeltrace2/plugins"
+            LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="${WORKSPACE}/deps/build/lib/babeltrace2/plugin-providers"
+        )
+        LTTNG_UST_JAVA_TESTS_MAVEN_OPTS=(
+            "-Dmaven.test.failure.ignore=true"
+            "-Dcommon-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-common.jar"
+            "-Djul-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-jul.jar"
+            "-Dlog4j-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j.jar"
+            "-Dlog4j2-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j2.jar"
+            "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/lib"
+            '-Dgroups=!domain:log4j2'
+        )
+        env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version
+        env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" lttng-sessiond -b -vvv 1>"${WORKSPACE}/log/lttng-ust-java-tests-lttng-sessiond.log" 2>&1
+        env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn "${LTTNG_UST_JAVA_TESTS_MAVEN_OPTS[@]}" clean verify || exit_status=1
+        killall lttng-sessiond
+
+        cd "${OWD}"
+    fi
 fi
 
 if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ "$conf" =~ (no-ust|relayd-only) ]]; then
diff --git a/scripts/lttng-ust-java-tests/start-sessiond.sh b/scripts/lttng-ust-java-tests/start-sessiond.sh
deleted file mode 100755 (executable)
index 894b519..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-set -exu
-
-# Start the lttng-sessiond
-lttng-sessiond -b -vvv 1>lttng-sessiond.log 2>&1
diff --git a/scripts/lttng-ust-java-tests/stop-sessiond.sh b/scripts/lttng-ust-java-tests/stop-sessiond.sh
deleted file mode 100755 (executable)
index de1e737..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-set -exu
-
-# Kill the sessiond
-killall lttng-sessiond
This page took 0.027951 seconds and 4 git commands to generate.