Start required docker services before running tests (#15217)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4492549d80
Коммит
9333b7d896
30
Makefile
30
Makefile
@@ -1,4 +1,4 @@
|
||||
.PHONY: build package run stop run-client run-server stop-client stop-server restart restart-server restart-client start-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist prepare-enteprise run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-quick test-server-race
|
||||
.PHONY: build package run stop run-client run-server stop-client stop-server restart restart-server restart-client start-docker clean-dist clean nuke check-style check-client-style check-server-style check-unit-tests test dist prepare-enteprise run-client-tests setup-run-client-tests cleanup-run-client-tests test-client build-linux build-osx build-windows internal-test-web-client vet run-server-for-web-client-tests diff-config prepackaged-plugins prepackaged-binaries test-server test-server-ee test-server-quick test-server-race start-docker-check
|
||||
|
||||
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
@@ -128,11 +128,19 @@ ifeq ($(RUN_SERVER_IN_BACKGROUND),true)
|
||||
RUN_IN_BACKGROUND := &
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
ifeq (,$(findstring openldap,$(ENABLED_DOCKER_SERVICES)))
|
||||
ENABLED_DOCKER_SERVICES:=$(ENABLED_DOCKER_SERVICES) openldap
|
||||
endif
|
||||
start-docker-check:
|
||||
ifeq (,$(findstring minio,$(ENABLED_DOCKER_SERVICES)))
|
||||
TEMP_DOCKER_SERVICES:=$(TEMP_DOCKER_SERVICES) minio
|
||||
endif
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
ifeq (,$(findstring openldap,$(ENABLED_DOCKER_SERVICES)))
|
||||
TEMP_DOCKER_SERVICES:=$(TEMP_DOCKER_SERVICES) openldap
|
||||
endif
|
||||
ifeq (,$(findstring elasticsearch,$(ENABLED_DOCKER_SERVICES)))
|
||||
TEMP_DOCKER_SERVICES:=$(TEMP_DOCKER_SERVICES) elasticsearch
|
||||
endif
|
||||
endif
|
||||
ENABLED_DOCKER_SERVICES:=$(ENABLED_DOCKER_SERVICES) $(TEMP_DOCKER_SERVICES)
|
||||
|
||||
start-docker: ## Starts the docker containers for local development.
|
||||
ifneq ($(IS_CI),false)
|
||||
@@ -323,15 +331,23 @@ gomodtidy:
|
||||
fi;
|
||||
@rm go.*.orig;
|
||||
|
||||
test-server: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs tests.
|
||||
test-server: check-prereqs-enterprise start-docker-check start-docker go-junit-report do-cover-file ## Runs tests.
|
||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||
@echo Running all tests
|
||||
else
|
||||
@echo Running only TE tests
|
||||
endif
|
||||
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(ALL_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)"
|
||||
ifneq ($(IS_CI),true)
|
||||
ifneq ($(MM_NO_DOCKER),true)
|
||||
ifneq ($(TEMP_DOCKER_SERVICES),)
|
||||
@echo Stopping temporary docker services
|
||||
docker-compose stop $(TEMP_DOCKER_SERVICES)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
test-server-ee: check-prereqs-enterprise start-docker go-junit-report do-cover-file ## Runs EE tests.
|
||||
test-server-ee: check-prereqs-enterprise start-docker-check start-docker go-junit-report do-cover-file ## Runs EE tests.
|
||||
@echo Running only EE tests
|
||||
./scripts/test.sh "$(GO)" "$(GOFLAGS)" "$(EE_PACKAGES)" "$(TESTS)" "$(TESTFLAGS)" "$(GOBIN)"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# Possible options: mysql, postgres, minio, inbucket, openldap, dejavu,
|
||||
# keycloak and elasticsearch
|
||||
#
|
||||
# Must be space spearated names.
|
||||
# Must be space separated names.
|
||||
#
|
||||
# Example: mysql postgres elasticsearch
|
||||
ENABLED_DOCKER_SERVICES ?= mysql postgres inbucket
|
||||
|
||||
Ссылка в новой задаче
Block a user