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

Run smoke tests against NLC and snapshot images #615

Merged
merged 5 commits into from
Jul 25, 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
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 @@ -50,5 +52,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:
- "v5.*"

env:
test_container_name_ee: hazelcast-ee-test

jobs:
push:
Expand Down Expand Up @@ -52,5 +54,26 @@ jobs:
--build-arg HAZELCAST_ZIP_URL=${HAZELCAST_ZIP_URL} \
--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 @@ -34,6 +36,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 @@ -34,6 +36,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