diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-29 23:43:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-29 15:43:07 +0000 |
commit | e2c505f5ce6b91709f267aea15f3f4699528ea26 (patch) | |
tree | 84d4c85780b214ef30820d62e6369fa59eddbaaa /Makefile | |
parent | 79ce91fddee549514c98f002b719fc8cda0e380f (diff) | |
download | gitea-e2c505f5ce6b91709f267aea15f3f4699528ea26.tar.gz gitea-e2c505f5ce6b91709f267aea15f3f4699528ea26.zip |
Add RACE_ENABLED=1 envs for make test* (#10055)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -30,6 +30,10 @@ EXTRA_GOFLAGS ?= MAKE_VERSION := $(shell $(MAKE) -v | head -n 1) +ifneq ($(RACE_ENABLED),) + GOTESTFLAGS ?= -race +endif + ifneq ($(DRONE_TAG),) VERSION ?= $(subst v,,$(DRONE_TAG)) GITEA_VERSION ?= $(VERSION) @@ -219,7 +223,7 @@ fmt-check: .PHONY: test test: - GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES) + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES) PHONY: test-check test-check: @@ -246,7 +250,7 @@ coverage: .PHONY: unit-test-coverage unit-test-coverage: - GO111MODULE=on $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 .PHONY: vendor vendor: @@ -371,42 +375,42 @@ integration-test-coverage: integrations.cover.test generate-ini-mysql GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out integrations.mysql.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test integrations.mysql8.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test integrations.pgsql.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test integrations.mssql.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test integrations.sqlite.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' integrations.cover.test: git-check $(GO_SOURCES) - GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test + GO111MODULE=on $(GO) test $(GOTESTFLAGS) -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test .PHONY: migrations.mysql.test migrations.mysql.test: $(GO_SOURCES) - $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test + $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test .PHONY: migrations.mysql8.test migrations.mysql8.test: $(GO_SOURCES) - $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test + $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test .PHONY: migrations.pgsql.test migrations.pgsql.test: $(GO_SOURCES) - $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test + $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test .PHONY: migrations.mssql.test migrations.mssql.test: $(GO_SOURCES) - $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test + $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test .PHONY: migrations.sqlite.test migrations.sqlite.test: $(GO_SOURCES) - $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' + $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' .PHONY: check check: test |