From 46ec483ecbcd876c4c20645c7079d07898820acb Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Thu, 31 Oct 2024 16:23:55 -0700 Subject: [PATCH] chore: Add compose-up-ci and integration-tests-ci functions These functions override the local environment for CI. --- .github/workflows/test.yml | 9 ++------- stack | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf0d8446..ada9fa7a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,15 +43,10 @@ jobs: run: ./stack compose-init - name: Run stack - env: - DISABLE_TELEMETRY: true - run: ./stack compose-up -d + run: ./stack compose-up-ci -d - name: Run tests - env: - LOG_LEVEL: debug - DISABLE_TELEMETRY: true - run: ./stack integration-tests + run: ./stack integration-tests-ci - name: Display resource provider logs run: docker logs resource-provider diff --git a/stack b/stack index 2745449a..e688c437 100755 --- a/stack +++ b/stack @@ -35,12 +35,20 @@ function compose-up() { docker compose -f ./docker/docker-compose.dev.yml up "$@" } +function compose-up-ci() { + load-local-env + compose-env + export LOG_LEVEL=debug + export API_HOST= + export DISABLE_TELEMETRY=true + docker compose -f ./docker/docker-compose.dev.yml up "$@" +} + function compose-down() { compose-env docker compose -f ./docker/docker-compose.dev.yml down } - ############################################################################ # Load env variables from .local.dev ############################################################################ @@ -358,6 +366,15 @@ function integration-tests() { go test -v -count 1 . } +function integration-tests-ci() { + load-local-env + export LOG_LEVEL=debug + export API_HOST= + export DISABLE_TELEMETRY=true + cd test + go test -v -count 1 . +} + ############################################################################ # run #