diff --git a/pom.xml b/pom.xml index 3d88f1c5d6..bcaec3bc95 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ 8181 localhost cryostat-itests + cryostat-itest 3000 quay.io/cryostat/cryostat-grafana-dashboard 1.0.0 @@ -375,7 +376,7 @@ - start-container + start-cryostat pre-integration-test exec @@ -385,7 +386,7 @@ run --pod=${cryostat.itest.podName} - --name=cryostat-itest + --name=${cryostat.itest.containerName} --mount type=tmpfs,target=/opt/cryostat.d/conf.d --mount @@ -419,9 +420,9 @@ --env SSL_TRUSTSTORE_DIR=/opt/cryostat.d/truststore.d --env - GRAFANA_DATASOURCE_URL=http://${cryostat.itest.webHost}:8080 + GRAFANA_DATASOURCE_URL=http://${cryostat.itest.webHost}:${cryostat.itest.jfr-datasource.port} --env - GRAFANA_DASHBOARD_URL=http://${cryostat.itest.webHost}:3000 + GRAFANA_DASHBOARD_URL=http://${cryostat.itest.webHost}:${cryostat.itest.grafana.port} --detach --rm ${cryostat.imageStream}:${cryostat.imageVersion} @@ -430,7 +431,7 @@ - wait-for-container + wait-for-cryostat pre-integration-test exec @@ -441,59 +442,47 @@ 5m sh -c - until curl -sSk http://${cryostat.itest.webHost}:${cryostat.itest.webPort}/health; do sleep 10; done + until curl -sSk -o /dev/null http://${cryostat.itest.webHost}:${cryostat.itest.webPort}/health; do sleep 10; done ${skipITs} - capture-oci-logs - post-integration-test - - exec - - - ${imageBuilder} - - logs - cryostat-itest - - ${project.build.directory}/cryostat-itest-${maven.build.timestamp}.log - ${skipITs} - - - - stop-jfr-datasource - post-integration-test + wait-for-jfr-datasource + pre-integration-test exec - ${imageBuilder} + timeout - kill - jfr-datasource-itest + 5m + sh + -c + until curl -sSk -o /dev/null http://${cryostat.itest.webHost}:${cryostat.itest.jfr-datasource.port}; do sleep 10; done ${skipITs} - stop-grafana - post-integration-test + wait-for-grafana + pre-integration-test exec - ${imageBuilder} + timeout - kill - grafana-itest + 5m + sh + -c + until curl -sSk -o /dev/null http://${cryostat.itest.webHost}:${cryostat.itest.grafana.port}; do sleep 10; done ${skipITs} - stop-container + capture-oci-logs post-integration-test exec @@ -501,9 +490,10 @@ ${imageBuilder} - kill - cryostat-itest + logs + ${cryostat.itest.containerName} + ${project.build.directory}/${cryostat.itest.containerName}-${maven.build.timestamp}.log ${skipITs} diff --git a/repeated-integration-tests.bash b/repeated-integration-tests.bash index 85707e1c1a..9b1478ed99 100755 --- a/repeated-integration-tests.bash +++ b/repeated-integration-tests.bash @@ -10,7 +10,8 @@ else runs=1 fi -POD_NAME=cryostat-itests +POD_NAME="$(xpath -q -e 'project/properties/cryostat.itest.podName/text()' pom.xml)" +CONTAINER_NAME="$(xpath -q -e 'project/properties/cryostat.itest.containerName/text()' pom.xml)" function cleanup() { if podman pod exists "${POD_NAME}"; then @@ -24,16 +25,15 @@ STARTFLAGS=( "exec:exec@create-pod" "exec:exec@start-jfr-datasource" "exec:exec@start-grafana" - "exec:exec@start-container" - "exec:exec@wait-for-container" + "exec:exec@start-cryostat" + "exec:exec@wait-for-cryostat" + "exec:exec@wait-for-jfr-datasource" + "exec:exec@wait-for-grafana" "failsafe:integration-test" "failsafe:verify" ) STOPFLAGS=( - "exec:exec@stop-jfr-datasource" - "exec:exec@stop-grafana" - "exec:exec@stop-container" "exec:exec@destroy-pod" ) @@ -57,7 +57,7 @@ while [ "${runcount}" -lt "${runs}" ]; do failures=$((failures+1)) fi runcount=$((runcount+1)) - podman pod logs -c cryostat-itest "${POD_NAME}" &>> "${server_logfile}" + podman pod logs -c "${CONTAINER_NAME}" "${POD_NAME}" &>> "${server_logfile}" mvn "${STOPFLAGS[@]}" |& tee -a >($PIPECLEANER >> "${client_logfile}") done