From a152d84edec20c2d20910f4c2729fe46a74f5ab5 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Sat, 22 Apr 2023 00:59:36 -0400 Subject: [PATCH 1/3] chore(test): add config to skip pulling test images --- pom.xml | 5 +++-- smoketest.sh | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index ab398bdde6..835fec402a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ io.cryostat.Cryostat 9091 8181 + always 8181 localhost cryostat-itests @@ -495,7 +496,7 @@ ${imageBuilder} run - --pull=always + --pull=${cryostat.itest.pullImages} --pod=${cryostat.itest.podName} --name=jfr-datasource-itest --detach @@ -515,7 +516,7 @@ ${imageBuilder} run - --pull=always + --pull=${cryostat.itest.pullImages} --pod=${cryostat.itest.podName} --name=grafana-itest --env diff --git a/smoketest.sh b/smoketest.sh index 4aebf72254..1e5833f2fc 100755 --- a/smoketest.sh +++ b/smoketest.sh @@ -4,6 +4,10 @@ set -x set -e +if [ -z "${PULL_IMAGES}" ]; then + PULL_IMAGES="always" +fi + getPomProperty() { if command -v xpath > /dev/null 2>&1 ; then xpath -q -e "project/properties/$1/text()" pom.xml @@ -198,7 +202,7 @@ runJfrDatasource() { fi podman run \ --name jfr-datasource \ - --pull always \ + --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ --rm -d "${DATASOURCE_IMAGE}" } @@ -215,7 +219,7 @@ runGrafana() { port="$(getPomProperty cryostat.itest.jfr-datasource.port)" podman run \ --name grafana \ - --pull always \ + --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ --env GF_INSTALL_PLUGINS=grafana-simple-json-datasource \ --env GF_AUTH_ANONYMOUS_ENABLED=true \ @@ -235,7 +239,7 @@ runReportGenerator() { port="$(getPomProperty cryostat.itest.reports.port)" podman run \ --name reports \ - --pull always \ + --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ --label io.cryostat.connectUrl="service:jmx:remote+http://localhost:${RJMX_PORT}" \ --cpus 1 \ From 50d6d0a8c332107659ae8a228b1304a7738d2bb4 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Sat, 22 Apr 2023 10:55:30 -0400 Subject: [PATCH 2/3] add env var handling to integration test script --- repeated-integration-tests.bash | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/repeated-integration-tests.bash b/repeated-integration-tests.bash index 045b5d3365..4c7d758bfb 100755 --- a/repeated-integration-tests.bash +++ b/repeated-integration-tests.bash @@ -38,6 +38,10 @@ if [ -z "${ITEST_IMG_VERSION}" ]; then ITEST_IMG_VERSION="${ITEST_IMG_VERSION,,}" # lowercase fi +if [ -z "${PULL_IMAGES}" ]; then + PULL_IMAGES="always" +fi + function cleanup() { if podman pod exists "${POD_NAME}"; then "${MVN}" exec:exec@destroy-pod @@ -47,6 +51,9 @@ trap cleanup EXIT cleanup STARTFLAGS=( + "-DfailIfNoTests=true" + "-Dcryostat.imageVersion=${ITEST_IMG_VERSION}" + "-Dcryostat.itest.pullImages=${PULL_IMAGES}" "build-helper:regex-property@image-tag-to-lower" "exec:exec@create-pod" "exec:exec@start-jfr-datasource" @@ -57,8 +64,6 @@ STARTFLAGS=( "exec:exec@wait-for-grafana" "failsafe:integration-test" "failsafe:verify" - "-DfailIfNoTests=true" - "-Dcryostat.imageVersion=${ITEST_IMG_VERSION}" ) if [ -n "$2" ]; then From bcac5a66dcddd9dbf52fb24918cce85041856b7d Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Sat, 22 Apr 2023 10:58:51 -0400 Subject: [PATCH 3/3] correct reports JDP config --- smoketest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smoketest.sh b/smoketest.sh index 1e5833f2fc..65443714fd 100755 --- a/smoketest.sh +++ b/smoketest.sh @@ -241,11 +241,11 @@ runReportGenerator() { --name reports \ --pull "${PULL_IMAGES}" \ --pod cryostat-pod \ - --label io.cryostat.connectUrl="service:jmx:remote+http://localhost:${RJMX_PORT}" \ + --label io.cryostat.connectUrl="service:jmx:rmi:///jndi/rmi://localhost:${RJMX_PORT}/jmxrmi" \ --cpus 1 \ --memory 512M \ --restart on-failure \ - --env JAVA_OPTIONS="-XX:ActiveProcessorCount=1 -XX:+UseSerialGC -Dorg.openjdk.jmc.flightrecorder.parser.singlethreaded=true -Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.rmi.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" \ + --env JAVA_OPTS="-XX:ActiveProcessorCount=1 -Dcom.sun.management.jmxremote.autodiscovery=true -Dcom.sun.management.jmxremote.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.rmi.port=${RJMX_PORT} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" \ --env QUARKUS_HTTP_PORT="${port}" \ --rm -d "${REPORTS_IMAGE}" }