From 8d37380b8a17cdaf449ecb11c587ada054817474 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Mon, 24 Apr 2023 18:25:38 -0400 Subject: [PATCH] chore(test): add config to skip pulling test images (#1466) * chore(test): add config to skip pulling test images * add env var handling to integration test script * correct reports JDP config (cherry picked from commit 043ea78186f05ac7e0755b6c7d262c110f0810ac) --- pom.xml | 5 +++-- repeated-integration-tests.bash | 9 +++++++-- smoketest.sh | 14 +++++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index a443f8ef01..4aaaebac4e 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/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 diff --git a/smoketest.sh b/smoketest.sh index 4aebf72254..65443714fd 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,13 +239,13 @@ 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}" \ + --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}" }