@@ -30,6 +30,10 @@ EXTRA_GOFLAGS ?=
30
30
31
31
MAKE_VERSION := $(shell $(MAKE ) -v | head -n 1)
32
32
33
+ ifneq ($(RACE_ENABLED ) ,)
34
+ GOTESTFLAGS ?= -race
35
+ endif
36
+
33
37
ifneq ($(DRONE_TAG ) ,)
34
38
VERSION ?= $(subst v,,$(DRONE_TAG))
35
39
GITEA_VERSION ?= $(VERSION)
@@ -219,7 +223,7 @@ fmt-check:
219
223
220
224
.PHONY : test
221
225
test :
222
- GO111MODULE=on $(GO ) test -mod=vendor -tags=' sqlite sqlite_unlock_notify' $(PACKAGES )
226
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -tags=' sqlite sqlite_unlock_notify' $(PACKAGES )
223
227
224
228
PHONY : test-check
225
229
test-check :
@@ -246,7 +250,7 @@ coverage:
246
250
247
251
.PHONY : unit-test-coverage
248
252
unit-test-coverage :
249
- 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
253
+ 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
250
254
251
255
.PHONY : vendor
252
256
vendor :
@@ -371,42 +375,42 @@ integration-test-coverage: integrations.cover.test generate-ini-mysql
371
375
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
372
376
373
377
integrations.mysql.test : git-check $(GO_SOURCES )
374
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
378
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
375
379
376
380
integrations.mysql8.test : git-check $(GO_SOURCES )
377
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
381
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
378
382
379
383
integrations.pgsql.test : git-check $(GO_SOURCES )
380
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
384
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
381
385
382
386
integrations.mssql.test : git-check $(GO_SOURCES )
383
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
387
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
384
388
385
389
integrations.sqlite.test : git-check $(GO_SOURCES )
386
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags ' sqlite sqlite_unlock_notify'
390
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags ' sqlite sqlite_unlock_notify'
387
391
388
392
integrations.cover.test : git-check $(GO_SOURCES )
389
- GO111MODULE=on $(GO ) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES ) | tr ' ' ',') -o integrations.cover.test
393
+ GO111MODULE=on $(GO ) test $( GOTESTFLAGS ) -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES ) | tr ' ' ',') -o integrations.cover.test
390
394
391
395
.PHONY : migrations.mysql.test
392
396
migrations.mysql.test : $(GO_SOURCES )
393
- $(GO ) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test
397
+ $(GO ) test $( GOTESTFLAGS ) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test
394
398
395
399
.PHONY : migrations.mysql8.test
396
400
migrations.mysql8.test : $(GO_SOURCES )
397
- $(GO ) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test
401
+ $(GO ) test $( GOTESTFLAGS ) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test
398
402
399
403
.PHONY : migrations.pgsql.test
400
404
migrations.pgsql.test : $(GO_SOURCES )
401
- $(GO ) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test
405
+ $(GO ) test $( GOTESTFLAGS ) -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test
402
406
403
407
.PHONY : migrations.mssql.test
404
408
migrations.mssql.test : $(GO_SOURCES )
405
- $(GO ) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test
409
+ $(GO ) test $( GOTESTFLAGS ) -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test
406
410
407
411
.PHONY : migrations.sqlite.test
408
412
migrations.sqlite.test : $(GO_SOURCES )
409
- $(GO ) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags ' sqlite sqlite_unlock_notify'
413
+ $(GO ) test $( GOTESTFLAGS ) -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags ' sqlite sqlite_unlock_notify'
410
414
411
415
.PHONY : check
412
416
check : test
0 commit comments