From baf0a1b97cf7dd98dd901000639dfb808bc52ebd Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sun, 15 Oct 2023 16:00:47 -0400 Subject: [PATCH] ci(hotrod): Print HotROD container logs in case of test failure Signed-off-by: Yuri Shkuro --- .github/workflows/ci-hotrod.yml | 4 ++++ scripts/hotrod-integration-test.sh | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-hotrod.yml b/.github/workflows/ci-hotrod.yml index aa6467d583d..f0951e9827f 100644 --- a/.github/workflows/ci-hotrod.yml +++ b/.github/workflows/ci-hotrod.yml @@ -49,3 +49,7 @@ jobs: env: DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} + + - name: Print logs from hotrod + run: docker logs example-hotrod + if: failure() diff --git a/scripts/hotrod-integration-test.sh b/scripts/hotrod-integration-test.sh index d9a907d718c..fa7577ceb82 100755 --- a/scripts/hotrod-integration-test.sh +++ b/scripts/hotrod-integration-test.sh @@ -10,10 +10,12 @@ make build-examples GOOS=linux GOARCH=arm64 REPO=jaegertracing/example-hotrod platforms="linux/amd64,linux/s390x,linux/ppc64le,linux/arm64" make prepare-docker-buildx -#build image locally for integration test + +# build image locally (-l) for integration test bash scripts/build-upload-a-docker-image.sh -l -c example-hotrod -d examples/hotrod -p "${platforms}" -export CID=$(docker run -d -p 8080:8080 localhost:5000/$REPO:${GITHUB_SHA}) +# pass --name example-hotrod so that we can do `docker logs example-hotrod` later +export CID=$(docker run -d --name example-hotrod -p 8080:8080 localhost:5000/$REPO:${GITHUB_SHA}) i=0 while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8080)" != "200" && ${i} -lt 30 ]]; do sleep 1