Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): add config to skip pulling test images (backport #1466) #1470

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<cryostat.mainClass>io.cryostat.Cryostat</cryostat.mainClass>
<cryostat.rjmxPort>9091</cryostat.rjmxPort>
<cryostat.webPort>8181</cryostat.webPort>
<cryostat.itest.pullImages>always</cryostat.itest.pullImages>
<cryostat.itest.webPort>8181</cryostat.itest.webPort>
<cryostat.itest.webHost>localhost</cryostat.itest.webHost>
<cryostat.itest.podName>cryostat-itests</cryostat.itest.podName>
Expand Down Expand Up @@ -495,7 +496,7 @@
<executable>${imageBuilder}</executable>
<arguments>
<argument>run</argument>
<argument>--pull=always</argument>
<argument>--pull=${cryostat.itest.pullImages}</argument>
<argument>--pod=${cryostat.itest.podName}</argument>
<argument>--name=jfr-datasource-itest</argument>
<argument>--detach</argument>
Expand All @@ -515,7 +516,7 @@
<executable>${imageBuilder}</executable>
<arguments>
<argument>run</argument>
<argument>--pull=always</argument>
<argument>--pull=${cryostat.itest.pullImages}</argument>
<argument>--pod=${cryostat.itest.podName}</argument>
<argument>--name=grafana-itest</argument>
<argument>--env</argument>
Expand Down
9 changes: 7 additions & 2 deletions repeated-integration-tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down
14 changes: 9 additions & 5 deletions smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -198,7 +202,7 @@ runJfrDatasource() {
fi
podman run \
--name jfr-datasource \
--pull always \
--pull "${PULL_IMAGES}" \
--pod cryostat-pod \
--rm -d "${DATASOURCE_IMAGE}"
}
Expand All @@ -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 \
Expand All @@ -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}"
}
Expand Down