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

fix(ci): add ITEST_IMG_VERSION arg to repeated-tests bash script #1153

Merged
merged 3 commits into from
Oct 24, 2022
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ jobs:
with:
step: restore
- name: Run integration tests
run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest bash repeated-integration-tests.bash
run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest ITEST_IMG_VERSION=latest bash repeated-integration-tests.bash
- name: Print itest logs
if: ${{ failure() }}
run: ls -1dt target/cryostat-itests-*.log | head -n1 | xargs cat
run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat
- uses: skjolber/maven-cache-github-action@v1
with:
step: save
Expand Down
10 changes: 8 additions & 2 deletions repeated-integration-tests.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ if [ -z "${CONTAINER_NAME}" ]; then
CONTAINER_NAME="$(xpath -q -e 'project/properties/cryostat.itest.containerName/text()' pom.xml)"
fi

if [ -z "${ITEST_IMG_VERSION}" ]; then
ITEST_IMG_VERSION="$(xpath -q -e 'project/version/text()' pom.xml)"
ITEST_IMG_VERSION="${ITEST_IMG_VERSION,,}" # lowercase
fi

function cleanup() {
if podman pod exists "${POD_NAME}"; then
"${MVN}" exec:exec@destroy-pod
Expand All @@ -43,6 +48,7 @@ STARTFLAGS=(
"failsafe:integration-test"
"failsafe:verify"
"-DfailIfNoTests=true"
"-Dcryostat.imageVersion=${ITEST_IMG_VERSION}"
)

if [ -n "$2" ]; then
Expand All @@ -68,8 +74,8 @@ DIR="$(dirname "$(readlink -f "$0")")"
runcount=0
while [ "${runcount}" -lt "${runs}" ]; do
timestamp="$(date -Iminutes)"
client_logfile="$DIR/target/${POD_NAME}-${timestamp}.client.log"
server_logfile="$DIR/target/${POD_NAME}-${timestamp}.server.log"
client_logfile="$DIR/target/${CONTAINER_NAME}-${timestamp}.client.log"
server_logfile="$DIR/target/${CONTAINER_NAME}-${timestamp}.server.log"
mkdir -p "$(dirname "$client_logfile")"
mkdir -p "$(dirname "$server_logfile")"
>"${client_logfile}"
Expand Down