loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'Makefile: support gotestsum' (#5249) from yoctozepto/gotestsum into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5249
Reviewed-by: Otto <otto@codeberg.org>

Otto cb91e5a4 2c4a3d66

+47 -37
+47 -37
Makefile
··· 24 24 COMMA := , 25 25 DIFF ?= diff --unified 26 26 27 + ifeq ($(USE_GOTESTSUM), yes) 28 + GOTEST ?= gotestsum -- 29 + GOTESTCOMPILEDRUNPREFIX ?= gotestsum --raw-command -- go tool test2json -t 30 + GOTESTCOMPILEDRUNSUFFIX ?= -test.v=test2json 31 + else 32 + GOTEST ?= $(GO) test 33 + GOTESTCOMPILEDRUNPREFIX ?= 34 + GOTESTCOMPILEDRUNSUFFIX ?= 35 + endif 36 + 27 37 XGO_VERSION := go-1.21.x 28 38 29 39 AIR_PACKAGE ?= github.com/air-verse/air@v1 # renovate: datasource=go ··· 534 544 .PHONY: test-backend 535 545 test-backend: 536 546 @echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..." 537 - @$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_TEST_PACKAGES) 547 + @$(GOTEST) $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_TEST_PACKAGES) 538 548 539 549 .PHONY: test-remote-cacher 540 550 test-remote-cacher: 541 551 @echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..." 542 - @$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_TEST_REMOTE_CACHER_PACKAGES) 552 + @$(GOTEST) $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_TEST_REMOTE_CACHER_PACKAGES) 543 553 544 554 .PHONY: test-frontend 545 555 test-frontend: node_modules ··· 564 574 .PHONY: test\#% 565 575 test\#%: 566 576 @echo "Running go test with -tags '$(TEST_TAGS)'..." 567 - @$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES) 577 + @$(GOTEST) $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES) 568 578 569 579 .PHONY: coverage 570 580 coverage: ··· 575 585 .PHONY: unit-test-coverage 576 586 unit-test-coverage: 577 587 @echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..." 578 - @$(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 588 + @$(GOTEST) $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_TEST_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 579 589 580 590 .PHONY: tidy 581 591 tidy: ··· 608 618 609 619 .PHONY: test-sqlite 610 620 test-sqlite: integrations.sqlite.test generate-ini-sqlite 611 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.sqlite.test 621 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) 612 622 613 623 .PHONY: test-sqlite\#% 614 624 test-sqlite\#%: integrations.sqlite.test generate-ini-sqlite 615 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$*) 625 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run $(subst .,/,$*) 616 626 617 627 .PHONY: test-sqlite-migration 618 628 test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test ··· 629 639 630 640 .PHONY: test-mysql 631 641 test-mysql: integrations.mysql.test generate-ini-mysql 632 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./integrations.mysql.test 642 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) 633 643 634 644 .PHONY: test-mysql\#% 635 645 test-mysql\#%: integrations.mysql.test generate-ini-mysql 636 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$*) 646 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run $(subst .,/,$*) 637 647 638 648 .PHONY: test-mysql-migration 639 649 test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test ··· 651 661 652 662 .PHONY: test-pgsql 653 663 test-pgsql: integrations.pgsql.test generate-ini-pgsql 654 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test 664 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) 655 665 656 666 .PHONY: test-pgsql\#% 657 667 test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql 658 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$*) 668 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./integrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run $(subst .,/,$*) 659 669 660 670 .PHONY: test-pgsql-migration 661 671 test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test ··· 674 684 675 685 .PHONY: test-e2e-sqlite 676 686 test-e2e-sqlite: playwright e2e.sqlite.test generate-ini-sqlite 677 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test -test.run TestE2e 687 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e 678 688 679 689 .PHONY: test-e2e-sqlite\#% 680 690 test-e2e-sqlite\#%: playwright e2e.sqlite.test generate-ini-sqlite 681 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./e2e.sqlite.test -test.run TestE2e/$* 691 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e/$* 682 692 683 693 .PHONY: test-e2e-sqlite-firefox\#% 684 694 test-e2e-sqlite-firefox\#%: playwright e2e.sqlite.test generate-ini-sqlite 685 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini PLAYWRIGHT_PROJECT=firefox ./e2e.sqlite.test -test.run TestE2e/$* 695 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini PLAYWRIGHT_PROJECT=firefox $(GOTESTCOMPILEDRUNPREFIX) ./e2e.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e/$* 686 696 687 697 .PHONY: test-e2e-mysql 688 698 test-e2e-mysql: playwright e2e.mysql.test generate-ini-mysql 689 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e 699 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e 690 700 691 701 .PHONY: test-e2e-mysql\#% 692 702 test-e2e-mysql\#%: playwright e2e.mysql.test generate-ini-mysql 693 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./e2e.mysql.test -test.run TestE2e/$* 703 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e/$* 694 704 695 705 .PHONY: test-e2e-pgsql 696 706 test-e2e-pgsql: playwright e2e.pgsql.test generate-ini-pgsql 697 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test -test.run TestE2e 707 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e 698 708 699 709 .PHONY: test-e2e-pgsql\#% 700 710 test-e2e-pgsql\#%: playwright e2e.pgsql.test generate-ini-pgsql 701 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./e2e.pgsql.test -test.run TestE2e/$* 711 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./e2e.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) -test.run TestE2e/$* 702 712 703 713 .PHONY: test-e2e-debugserver 704 714 test-e2e-debugserver: e2e.sqlite.test generate-ini-sqlite ··· 726 736 GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out 727 737 728 738 integrations.mysql.test: git-check $(GO_SOURCES) 729 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test 739 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test 730 740 731 741 integrations.pgsql.test: git-check $(GO_SOURCES) 732 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test 742 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test 733 743 734 744 integrations.sqlite.test: git-check $(GO_SOURCES) 735 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)' 745 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)' 736 746 737 747 integrations.cover.test: git-check $(GO_SOURCES) 738 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test 748 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test 739 749 740 750 integrations.cover.sqlite.test: git-check $(GO_SOURCES) 741 - $(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)' 751 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)' 742 752 743 753 .PHONY: migrations.mysql.test 744 754 migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql 745 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test 746 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test 755 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test 756 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.mysql.test $(GOTESTCOMPILEDRUNSUFFIX) 747 757 748 758 .PHONY: migrations.pgsql.test 749 759 migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql 750 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test 751 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test 760 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test 761 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.pgsql.test $(GOTESTCOMPILEDRUNSUFFIX) 752 762 753 763 .PHONY: migrations.sqlite.test 754 764 migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite 755 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)' 756 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./migrations.sqlite.test 765 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)' 766 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTESTCOMPILEDRUNPREFIX) ./migrations.sqlite.test $(GOTESTCOMPILEDRUNSUFFIX) 757 767 758 768 .PHONY: migrations.individual.mysql.test 759 769 migrations.individual.mysql.test: $(GO_SOURCES) 760 770 for pkg in $(MIGRATION_PACKAGES); do \ 761 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \ 771 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \ 762 772 done 763 773 764 774 .PHONY: migrations.individual.sqlite.test\#% 765 775 migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite 766 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 776 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 767 777 768 778 .PHONY: migrations.individual.pgsql.test 769 779 migrations.individual.pgsql.test: $(GO_SOURCES) 770 780 for pkg in $(MIGRATION_PACKAGES); do \ 771 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1;\ 781 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1;\ 772 782 done 773 783 774 784 .PHONY: migrations.individual.pgsql.test\#% 775 785 migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql 776 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 786 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 777 787 778 788 .PHONY: migrations.individual.sqlite.test 779 789 migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite 780 790 for pkg in $(MIGRATION_PACKAGES); do \ 781 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \ 791 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg || exit 1; \ 782 792 done 783 793 784 794 .PHONY: migrations.individual.sqlite.test\#% 785 795 migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite 786 - GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 796 + GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GOTEST) $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$* 787 797 788 798 e2e.mysql.test: $(GO_SOURCES) 789 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test 799 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test 790 800 791 801 e2e.pgsql.test: $(GO_SOURCES) 792 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test 802 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.pgsql.test 793 803 794 804 e2e.sqlite.test: $(GO_SOURCES) 795 - $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)' 805 + $(GOTEST) $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.sqlite.test -tags '$(TEST_TAGS)' 796 806 797 807 .PHONY: check 798 808 check: test