Skip to content

Commit

Permalink
Run smoke tests against NLC and snapshot images [4.2.z] (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldziedziul committed Aug 30, 2023
1 parent 8713baa commit df614bc
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/scripts/simple-smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function test_docker_image() {
local image=$1
local container_name=$2
echo "Starting container '$container_name' from image '$image'"
docker run -it --name "$container_name" -e HZ_LICENSEKEY -d -p5701:5701 "$image"
docker run -it --name "$container_name" -e HZ_LICENSEKEY -e HZ_INSTANCETRACKING_FILENAME -d -p5701:5701 "$image"
local key="some-key"
local expected="some-value"
echo "Putting value '$expected' for key '$key'"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/ee-nlc-snapshot-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
HZ_EE_REVISION:
description: 'Commit id of Hazelcast Enterprise snapshot jar'
required: true
env:
test_container_name_ee: hazelcast-ee-test

jobs:
push:
Expand Down Expand Up @@ -51,5 +53,26 @@ jobs:
--label hazelcast.ee.revision=${{ github.event.inputs.HZ_EE_REVISION }} \
--tag ${NLC_IMAGE_NAME}:${HZ_VERSION} hazelcast-enterprise
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
export HZ_INSTANCETRACKING_FILENAME=instance-tracking.txt
.github/scripts/simple-smoke-test.sh ${NLC_IMAGE_NAME}:${HZ_VERSION} ${{ env.test_container_name_ee }}
- name: Get docker logs
if: ${{ always() }}
run: |
DOCKER_LOG_FILE_EE=docker-hazelcast-ee-test.log
echo "DOCKER_LOG_FILE_EE=${DOCKER_LOG_FILE_EE}" >> $GITHUB_ENV
docker logs ${{ env.test_container_name_ee }} > ${DOCKER_LOG_FILE_EE}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: |
${{ env.DOCKER_LOG_FILE_EE }}
- name: Push EE image
run: docker push ${NLC_IMAGE_NAME}:${HZ_VERSION}
23 changes: 23 additions & 0 deletions .github/workflows/ee-nlc-tag-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
tags:
- "v4.*"

env:
test_container_name_ee: hazelcast-ee-test

jobs:
push:
Expand Down Expand Up @@ -55,5 +57,26 @@ jobs:
--build-arg HZ_VERSION=${RELEASE_VERSION} \
--tag ${NLC_IMAGE_NAME}:${RELEASE_VERSION} hazelcast-enterprise
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
export HZ_INSTANCETRACKING_FILENAME=instance-tracking.txt
.github/scripts/simple-smoke-test.sh ${NLC_IMAGE_NAME}:${RELEASE_VERSION} ${{ env.test_container_name_ee }}
- name: Get docker logs
if: ${{ always() }}
run: |
DOCKER_LOG_FILE_EE=docker-hazelcast-ee-test.log
echo "DOCKER_LOG_FILE_EE=${DOCKER_LOG_FILE_EE}" >> $GITHUB_ENV
docker logs ${{ env.test_container_name_ee }} > ${DOCKER_LOG_FILE_EE}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: |
${{ env.DOCKER_LOG_FILE_EE }}
- name: Push EE image
run: docker push ${NLC_IMAGE_NAME}:${RELEASE_VERSION}
31 changes: 31 additions & 0 deletions .github/workflows/ee_latest_snapshot_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
HZ_EE_REVISION:
description: 'Commit id of Hazelcast Enterprise snapshot jar'
required: true
env:
test_container_name_ee: hazelcast-ee-test

jobs:
push:
Expand All @@ -25,6 +27,35 @@ jobs:
with:
version: v0.5.1

- name: Build Test EE image
run: |
docker buildx build --load \
--build-arg HZ_VERSION=${{ github.event.inputs.HZ_VERSION }} \
--build-arg HZ_VARIANT=${{ matrix.variant }} \
--tag hazelcast-ee:test \
hazelcast-enterprise
- name: Run smoke test against EE image
timeout-minutes: 2
run: |
export HZ_LICENSEKEY=${{ secrets.HZ_ENTERPRISE_LICENSE }}
.github/scripts/simple-smoke-test.sh hazelcast-ee:test ${{ env.test_container_name_ee }}
- name: Get docker logs
if: ${{ always() }}
run: |
DOCKER_LOG_FILE_EE=docker-hazelcast-ee-test${{ matrix.suffix }}.log
echo "DOCKER_LOG_FILE_EE=${DOCKER_LOG_FILE_EE}" >> $GITHUB_ENV
docker logs ${{ env.test_container_name_ee }} > ${DOCKER_LOG_FILE_EE}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: |
${{ env.DOCKER_LOG_FILE_EE }}
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/oss_latest_snapshot_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
HZ_REVISION:
description: 'Commit id of Hazelcast snapshot jar'
required: true
env:
test_container_name_oss: hazelcast-oss-test

jobs:
push:
Expand All @@ -25,6 +27,34 @@ jobs:
with:
version: v0.5.1

- name: Build Test OSS image
run: |
docker buildx build --load \
--build-arg HZ_VERSION=${{ github.event.inputs.HZ_VERSION }} \
--build-arg HZ_VARIANT=${{ matrix.variant }} \
--tag hazelcast-oss:test \
hazelcast-oss
- name: Run smoke test against OSS image
timeout-minutes: 2
run: |
.github/scripts/simple-smoke-test.sh hazelcast-oss:test ${{ env.test_container_name_oss }}
- name: Get docker logs
if: ${{ always() }}
run: |
DOCKER_LOG_FILE_OSS=docker-hazelcast-oss-test${{ matrix.suffix }}.log
echo "DOCKER_LOG_FILE_OSS=${DOCKER_LOG_FILE_OSS}" >> $GITHUB_ENV
docker logs ${{ env.test_container_name_oss }} > ${DOCKER_LOG_FILE_OSS}
- name: Store docker logs as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: |
${{ env.DOCKER_LOG_FILE_OSS }}
- name: Login to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

Expand Down

0 comments on commit df614bc

Please sign in to comment.