From 7b5e4c30dc5331680ddda946148c79576cad5da8 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Sat, 11 Dec 2021 09:36:58 +0100 Subject: [PATCH] Change default to ./docker-compose.yml for integration tests --- makefiles/test-integration.mk | 2 +- templates/github/workflows/test-integration.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/makefiles/test-integration.mk b/makefiles/test-integration.mk index a2389b4..430b02f 100644 --- a/makefiles/test-integration.mk +++ b/makefiles/test-integration.mk @@ -3,7 +3,7 @@ GO ?= go # Override in app Makefile to add custom ldflags, example BUILD_LDFLAGS="-s -w" BUILD_LDFLAGS ?= "" INTEGRATION_TEST_TARGET ?= -coverpkg ./internal/... integration_test.go -INTEGRATION_DOCKER_COMPOSE ?= ./docker-compose.integration-test.yml +INTEGRATION_DOCKER_COMPOSE ?= ./docker-compose.yml ## Run integration tests test-integration: diff --git a/templates/github/workflows/test-integration.yml b/templates/github/workflows/test-integration.yml index 22e4f2f..aed0e88 100644 --- a/templates/github/workflows/test-integration.yml +++ b/templates/github/workflows/test-integration.yml @@ -9,6 +9,7 @@ on: env: GO111MODULE: "on" RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing. + DOCKER_COMPOSE_FILE: "./docker-compose.yml" jobs: test: strategy: @@ -49,7 +50,7 @@ jobs: ref: ${{ github.event.pull_request.base.sha }} path: __base - name: Docker Compose - run: (test -f ./dev/docker-compose.integration-test.yml && docker-compose -f ./dev/docker-compose.integration-test.yml up -d && docker ps && docker-compose -f ./dev/docker-compose.integration-test.yml logs) || echo "::warning ::Missing ./dev/docker-compose.integration-test.yml file" + run: (test -f ${{ env.DOCKER_COMPOSE_FILE }} && docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} up -d && docker ps && docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} logs) || echo "::warning ::Missing ${{ env.DOCKER_COMPOSE_FILE }} file" - name: Run test for base code if: matrix.go-version == '1.17.x' && env.RUN_BASE_COVERAGE == 'on' && steps.benchmark-base.outputs.cache-hit != 'true' && github.event.pull_request.base.sha != '' run: |