From 68d45ec89f33a24291627f820856e9b8a766d24b Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 28 Jun 2023 16:25:36 -0400 Subject: [PATCH] jjb: Run lttng-ust-java-tests when testing lttng-tools Change-Id: I379ec43d87c4a75be7c38b22aa35c4a13cf2bef1 --- .../ansible/roles/common-node/vars/Debian.yml | 1 + jobs/lttng-tools.yaml | 5 + jobs/lttng-ust-java-tests.yaml | 181 ------------------ scripts/lttng-tools/build.sh | 43 ++++- .../lttng-ust-java-tests/start-sessiond.sh | 6 - scripts/lttng-ust-java-tests/stop-sessiond.sh | 6 - 6 files changed, 48 insertions(+), 194 deletions(-) delete mode 100644 jobs/lttng-ust-java-tests.yaml delete mode 100755 scripts/lttng-ust-java-tests/start-sessiond.sh delete mode 100755 scripts/lttng-ust-java-tests/stop-sessiond.sh diff --git a/automation/ansible/roles/common-node/vars/Debian.yml b/automation/ansible/roles/common-node/vars/Debian.yml index 39c2a3a..24250ff 100644 --- a/automation/ansible/roles/common-node/vars/Debian.yml +++ b/automation/ansible/roles/common-node/vars/Debian.yml @@ -19,6 +19,7 @@ common_node_packages: - libtap-harness-archive-perl - libtool-bin - lzop + - maven - openssh-server - pbzip2 - psmisc diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index 9175626..c5e772e 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -452,6 +452,10 @@ + - junit: <tng-tools_publisher_junit_defaults + results: 'src/lttng-ust-java-tests/**/target/failsafe-reports/*.xml' + allow-empty-results: true + - archive: <tng-tools_publisher_archive_defaults artifacts: 'build/**,deps/**,tap/**,log/**' follow-symlinks: true @@ -718,6 +722,7 @@ - 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 index 375e65a..0000000 --- a/jobs/lttng-ust-java-tests.yaml +++ /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 - lttng-ust-java-tests - against the master branches of UST, lttng-tools, and Babeltrace. - -

Job is managed by Jenkins Job Builder.

- - 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: <tng-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' - diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 6467e11..d1d0d17 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -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 index 894b519..0000000 --- a/scripts/lttng-ust-java-tests/start-sessiond.sh +++ /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 index de1e737..0000000 --- a/scripts/lttng-ust-java-tests/stop-sessiond.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -exu - -# Kill the sessiond -killall lttng-sessiond -- 2.34.1