From c6b8e4887503a07f9b55647fe2a982203d67a304 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko <91597950+oksana-grishchenko@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:26:03 +0200 Subject: [PATCH] EVEREST-107 Fix tests run (#185) * add waiting step * go version * add waiting step to flows * go version & wait in cli-tests (cherry picked from commit 2dc4a55c73d8248f3e5c4c637bc91c45d1bbccd3) --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ .github/workflows/cli-tests.yml | 21 ++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 152bb6b9..65a7169f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -238,12 +238,23 @@ jobs: ref: 'main' path: percona-everest-backend + - name: Set up Go release for Everest BE + uses: percona-platform/setup-go@v4 + with: + go-version-file: './percona-everest-backend/go.mod' + - name: Run Everest backend working-directory: percona-everest-backend run: | make local-env-up SECRETS_ROOT_KEY=$(openssl rand -base64 32) make run-debug & + + - name: Set up Go release for CLI + uses: percona-platform/setup-go@v4 + with: + go-version-file: './go.mod' + - name: Build CLI binary run: | make init @@ -257,6 +268,16 @@ jobs: ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }} run: git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com" + - name: Wait for EVEREST BE to be available + timeout-minutes: 15 + run: | + while ! curl -sSf http://127.0.0.1:8080 > /dev/null; do + echo "Waiting for EVEREST BE..." + sleep 15 + done + echo "EVEREST BE is available." + + - name: Run integration tests working-directory: cli-tests id: cli-tests diff --git a/.github/workflows/cli-tests.yml b/.github/workflows/cli-tests.yml index 305a4ca0..c609626c 100644 --- a/.github/workflows/cli-tests.yml +++ b/.github/workflows/cli-tests.yml @@ -66,11 +66,16 @@ jobs: ref: 'main' path: percona-everest-backend + - name: Set up Go release for Everest BE + uses: percona-platform/setup-go@v4 + with: + go-version-file: './percona-everest-backend/go.mod' + - name: Run Everest backend working-directory: percona-everest-backend run: | make local-env-up - make run-debug & + SECRETS_ROOT_KEY=$(openssl rand -base64 32) make run-debug & # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # https://minikube.sigs.k8s.io/docs/drivers/docker/ @@ -82,6 +87,11 @@ jobs: minikube config set cpus 2 minikube start + - name: Set up Go release for CLI + uses: percona-platform/setup-go@v4 + with: + go-version-file: './go.mod' + - name: Build CLI binary run: | make init @@ -92,6 +102,15 @@ jobs: ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }} run: git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com" + - name: Wait for EVEREST BE to be available + timeout-minutes: 15 + run: | + while ! curl -sSf http://127.0.0.1:8080 > /dev/null; do + echo "Waiting for EVEREST BE..." + sleep 15 + done + echo "EVEREST BE is available." + - name: Run ${{ env.MAKE_TARGET }} integration tests working-directory: cli-tests id: cli-tests