From 5aaf4e470925b90132a93d1edf7f53d994a76200 Mon Sep 17 00:00:00 2001 From: Denis Mironov Date: Mon, 11 Nov 2024 15:41:27 +0100 Subject: [PATCH] Use node group instead of node uuid --- .github/workflows/ci.yaml | 2 +- test/docker-compose.single.yaml | 4 +++- test/docker-compose.split.yaml | 5 ++++- test/smoke_test.sh | 17 +++++++---------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e009e90..770249a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -128,7 +128,7 @@ jobs: ALLURE_TOKEN: ${{ steps.secrets.outputs.ALLURE_SERVER_TOKEN }} ALLURE_ENVIRONMENT_ARCH: ${{ matrix.ARCH }} USER_TOKEN: ${{ steps.secrets.outputs.user_token }} - WALLARM_API_TOKEN: ${{ steps.secrets.outputs.api_token }} + WALLARM_API_TOKEN: ${{ steps.secrets.outputs.user_token }} WALLARM_API_HOST: ${{ steps.secrets.outputs.api_host }} WALLARM_API_PRESET: ${{ steps.secrets.outputs.api_preset }} WEBHOOK_API_KEY: ${{ steps.secrets.outputs.webhook_api_key }} diff --git a/test/docker-compose.single.yaml b/test/docker-compose.single.yaml index 8d42c6a..6d58e88 100644 --- a/test/docker-compose.single.yaml +++ b/test/docker-compose.single.yaml @@ -7,7 +7,8 @@ services: WALLARM_API_HOST: ${WALLARM_API_HOST} WALLARM_API_CA_VERIFY: ${WALLARM_API_CA_VERIFY:-true} WALLARM_API_TOKEN: ${WALLARM_API_TOKEN} - WALLARM_LABELS: ${WALLARM_LABELS:-'group=defaultDockerNode'} + NODE_GROUP_NAME: ${NODE_GROUP_NAME} + WALLARM_LABELS: "group=${NODE_GROUP_NAME}" healthcheck: test: bash -c '[ -f /opt/wallarm/etc/wallarm/node.yaml ]' timeout: 5s @@ -19,6 +20,7 @@ services: pytest: image: dkr.wallarm.com/tests/smoke-tests:latest environment: + NODE_GROUP_NAME: ${NODE_GROUP_NAME} WALLARM_API_HOST: ${WALLARM_API_HOST} WALLARM_API_PRESET: ${WALLARM_API_PRESET:-audit} WALLARM_API_CA_VERIFY: ${WALLARM_API_CA_VERIFY:-true} diff --git a/test/docker-compose.split.yaml b/test/docker-compose.split.yaml index 502cc4e..8cd842d 100644 --- a/test/docker-compose.split.yaml +++ b/test/docker-compose.split.yaml @@ -7,8 +7,9 @@ services: WALLARM_API_HOST: ${WALLARM_API_HOST} WALLARM_API_CA_VERIFY: ${WALLARM_API_CA_VERIFY:-true} WALLARM_API_TOKEN: ${WALLARM_API_TOKEN} + NODE_GROUP_NAME: ${NODE_GROUP_NAME} + WALLARM_LABELS: ${WALLARM_LABELS} POSTANALYTIC_ADDRESS: post-analytics - WALLARM_LABELS: ${WALLARM_LABELS:-'group=defaultDockerNode'} healthcheck: test: bash -c '[ -f /opt/wallarm/etc/wallarm/node.yaml ]' timeout: 5s @@ -26,6 +27,7 @@ services: WALLARM_API_CA_VERIFY: ${WALLARM_API_CA_VERIFY:-true} WALLARM_API_TOKEN: ${WALLARM_API_TOKEN} POSTANALYTIC_ONLY: true + NODE_GROUP_NAME: ${NODE_GROUP_NAME} WALLARM_LABELS: ${WALLARM_LABELS} healthcheck: test: bash -c '[ -f /opt/wallarm/etc/wallarm/node.yaml ]' @@ -35,6 +37,7 @@ services: pytest: image: dkr.wallarm.com/tests/smoke-tests:latest environment: + NODE_GROUP_NAME: ${NODE_GROUP_NAME} WALLARM_API_HOST: ${WALLARM_API_HOST} WALLARM_API_PRESET: ${WALLARM_API_PRESET:-audit} WALLARM_API_CA_VERIFY: ${WALLARM_API_CA_VERIFY:-true} diff --git a/test/smoke_test.sh b/test/smoke_test.sh index c372117..88ed5f2 100755 --- a/test/smoke_test.sh +++ b/test/smoke_test.sh @@ -38,6 +38,7 @@ function check_mandatory_vars() { USER_TOKEN WEBHOOK_API_KEY WEBHOOK_UUID + NODE_GROUP_NAME ) for var in "${mandatory[@]}"; do @@ -91,6 +92,9 @@ set -a RED='\033[0;31m' NC='\033[0m' +export NODE_GROUP_NAME="github-docker-$(tr -dc A-Za-z0-9