@@ -100,7 +100,8 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
100
100
101
101
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
102
102
103
- GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO ) list ./... | grep -v /vendor/) )
103
+ GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO ) list ./... | grep -v /vendor/) )
104
+ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO ) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO ) list ./... | grep -v /vendor/) )
104
105
105
106
FOMANTIC_WORK_DIR := web_src/fomantic
106
107
@@ -366,7 +367,7 @@ test: test-frontend test-backend
366
367
.PHONY : test-backend
367
368
test-backend :
368
369
@echo " Running go test with $( GOTESTFLAGS) -tags '$( TEST_TAGS) '..."
369
- @$(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' $(GO_PACKAGES )
370
+ @$(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' $(GO_TEST_PACKAGES )
370
371
371
372
.PHONY : test-frontend
372
373
test-frontend : node_modules
@@ -387,7 +388,7 @@ test-check:
387
388
.PHONY : test\# %
388
389
test\#% :
389
390
@echo " Running go test with -tags '$( TEST_TAGS) '..."
390
- @$(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' -run $(subst .,/,$* ) $(GO_PACKAGES )
391
+ @$(GO ) test $(GOTESTFLAGS ) -tags=' $(TEST_TAGS)' -run $(subst .,/,$* ) $(GO_TEST_PACKAGES )
391
392
392
393
.PHONY : coverage
393
394
coverage :
@@ -398,7 +399,7 @@ coverage:
398
399
.PHONY : unit-test-coverage
399
400
unit-test-coverage :
400
401
@echo " Running unit-test-coverage $( GOTESTFLAGS) -tags '$( TEST_TAGS) '..."
401
- @$(GO ) test $(GOTESTFLAGS ) -timeout=20m -tags=' $(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES ) && echo " \n==>\033[32m Ok\033[m\n" || exit 1
402
+ @$(GO ) test $(GOTESTFLAGS ) -timeout=20m -tags=' $(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_TEST_PACKAGES ) && echo " \n==>\033[32m Ok\033[m\n" || exit 1
402
403
403
404
.PHONY : tidy
404
405
tidy :
@@ -442,14 +443,7 @@ test-sqlite\#%: integrations.sqlite.test generate-ini-sqlite
442
443
GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$* )
443
444
444
445
.PHONY : test-sqlite-migration
445
- test-sqlite-migration : migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
446
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini ./migrations.sqlite.test
447
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini ./migrations.individual.sqlite.test
448
-
449
- .PHONY : test-sqlite-migration\# %
450
- test-sqlite-migration\#% : migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
451
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini ./migrations.individual.sqlite.test -test.run $(subst .,/,$* )
452
-
446
+ test-sqlite-migration : migrations.sqlite.test migrations.individual.sqlite.test
453
447
454
448
generate-ini-mysql :
455
449
sed -e ' s|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
@@ -470,9 +464,7 @@ test-mysql\#%: integrations.mysql.test generate-ini-mysql
470
464
GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$* )
471
465
472
466
.PHONY : test-mysql-migration
473
- test-mysql-migration : migrations.mysql.test migrations.individual.mysql.test generate-ini-mysql
474
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
475
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql.ini ./migrations.individual.mysql.test
467
+ test-mysql-migration : migrations.mysql.test migrations.individual.mysql.test
476
468
477
469
generate-ini-mysql8 :
478
470
sed -e ' s|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
@@ -493,9 +485,7 @@ test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
493
485
GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$* )
494
486
495
487
.PHONY : test-mysql8-migration
496
- test-mysql8-migration : migrations.mysql8.test migrations.individual.mysql8.test generate-ini-mysql8
497
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
498
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql8.ini ./migrations.individual.mysql8.test
488
+ test-mysql8-migration : migrations.mysql8.test migrations.individual.mysql8.test
499
489
500
490
generate-ini-pgsql :
501
491
sed -e ' s|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
@@ -517,9 +507,7 @@ test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
517
507
GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$* )
518
508
519
509
.PHONY : test-pgsql-migration
520
- test-pgsql-migration : migrations.pgsql.test migrations.individual.pgsql.test generate-ini-pgsql
521
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test
522
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini ./migrations.individual.pgsql.test
510
+ test-pgsql-migration : migrations.pgsql.test migrations.individual.pgsql.test
523
511
524
512
generate-ini-mssql :
525
513
sed -e ' s|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
@@ -540,9 +528,7 @@ test-mssql\#%: integrations.mssql.test generate-ini-mssql
540
528
GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$* )
541
529
542
530
.PHONY : test-mssql-migration
543
- test-mssql-migration : migrations.mssql.test migrations.individual.mssql.test generate-ini-mssql
544
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini ./migrations.mssql.test -test.failfast
545
- GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini ./migrations.individual.mssql.test -test.failfast
531
+ test-mssql-migration : migrations.mssql.test migrations.individual.mssql.test
546
532
547
533
.PHONY : playwright
548
534
playwright : $(PLAYWRIGHT_DIR )
@@ -637,50 +623,82 @@ integrations.sqlite.test: git-check $(GO_SOURCES)
637
623
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags ' $(TEST_TAGS)'
638
624
639
625
integrations.cover.test : git-check $(GO_SOURCES )
640
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES ) | tr ' ' ',') -o integrations.cover.test
626
+ $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES ) | tr ' ' ',') -o integrations.cover.test
641
627
642
628
integrations.cover.sqlite.test : git-check $(GO_SOURCES )
643
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES ) | tr ' ' ',') -o integrations.cover.sqlite.test -tags ' $(TEST_TAGS)'
629
+ $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES ) | tr ' ' ',') -o integrations.cover.sqlite.test -tags ' $(TEST_TAGS)'
644
630
645
631
.PHONY : migrations.mysql.test
646
- migrations.mysql.test : $(GO_SOURCES )
632
+ migrations.mysql.test : $(GO_SOURCES ) generate-ini-mysql
647
633
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
634
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
648
635
649
636
.PHONY : migrations.mysql8.test
650
- migrations.mysql8.test : $(GO_SOURCES )
637
+ migrations.mysql8.test : $(GO_SOURCES ) generate-ini-mysql8
651
638
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql8.test
639
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
652
640
653
641
.PHONY : migrations.pgsql.test
654
- migrations.pgsql.test : $(GO_SOURCES )
642
+ migrations.pgsql.test : $(GO_SOURCES ) generate-ini-pgsql
655
643
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
644
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test
656
645
657
646
.PHONY : migrations.mssql.test
658
- migrations.mssql.test : $(GO_SOURCES )
647
+ migrations.mssql.test : $(GO_SOURCES ) generate-ini-mssql
659
648
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mssql.test
649
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini ./migrations.mssql.test
660
650
661
651
.PHONY : migrations.sqlite.test
662
- migrations.sqlite.test : $(GO_SOURCES )
652
+ migrations.sqlite.test : $(GO_SOURCES ) generate-ini-sqlite
663
653
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags ' $(TEST_TAGS)'
654
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini ./migrations.sqlite.test
664
655
665
656
.PHONY : migrations.individual.mysql.test
666
657
migrations.individual.mysql.test : $(GO_SOURCES )
667
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql.test
658
+ for pkg in $( shell $( GO) list code.gitea.io/gitea/models/migrations/...) ; do \
659
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' $$ pkg; \
660
+ done
668
661
669
662
.PHONY : migrations.individual.mysql8.test
670
663
migrations.individual.mysql8.test : $(GO_SOURCES )
671
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql8.test
664
+ for pkg in $( shell $( GO) list code.gitea.io/gitea/models/migrations/...) ; do \
665
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mysql8.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' $$ pkg; \
666
+ done
667
+
668
+ .PHONY : migrations.individual.mysql8.test\# %
669
+ migrations.individual.sqlite.test\#% : $(GO_SOURCES ) generate-ini-sqlite
670
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
672
671
673
672
.PHONY : migrations.individual.pgsql.test
674
673
migrations.individual.pgsql.test : $(GO_SOURCES )
675
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/models/migrations -o migrations.individual.pgsql.test
674
+ for pkg in $( shell $( GO) list code.gitea.io/gitea/models/migrations/...) ; do \
675
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' $$ pkg; \
676
+ done
677
+
678
+ .PHONY : migrations.individual.pgsql.test\# %
679
+ migrations.individual.pgsql.test\#% : $(GO_SOURCES ) generate-ini-pgsql
680
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/pgsql.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
681
+
676
682
677
683
.PHONY : migrations.individual.mssql.test
678
- migrations.individual.mssql.test : $(GO_SOURCES )
679
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mssql.test
684
+ migrations.individual.mssql.test : $(GO_SOURCES ) generate-ini-mssql
685
+ for pkg in $( shell $( GO) list code.gitea.io/gitea/models/migrations/...) ; do \
686
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' $$ pkg -test.failfast; \
687
+ done
688
+
689
+ .PHONY : migrations.individual.mssql.test\# %
690
+ migrations.individual.mssql.test\#% : $(GO_SOURCES ) generate-ini-mssql
691
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/mssql.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
680
692
681
693
.PHONY : migrations.individual.sqlite.test
682
- migrations.individual.sqlite.test : $(GO_SOURCES )
683
- $(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/models/migrations -o migrations.individual.sqlite.test -tags ' $(TEST_TAGS)'
694
+ migrations.individual.sqlite.test : $(GO_SOURCES ) generate-ini-sqlite
695
+ for pkg in $( shell $( GO) list code.gitea.io/gitea/models/migrations/...) ; do \
696
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' $$ pkg; \
697
+ done
698
+
699
+ .PHONY : migrations.individual.sqlite.test\# %
700
+ migrations.individual.sqlite.test\#% : $(GO_SOURCES ) generate-ini-sqlite
701
+ GITEA_ROOT=" $( CURDIR) " GITEA_CONF=tests/sqlite.ini $(GO ) test $(GOTESTFLAGS ) -tags ' $(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
684
702
685
703
e2e.mysql.test : $(GO_SOURCES )
686
704
$(GO ) test $(GOTESTFLAGS ) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test
0 commit comments