From 2065c349c0ac465c146a0cc5b09ded1c08a2d7c9 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 21 Mar 2024 11:33:56 +0800 Subject: [PATCH 1/3] chore: build backend before integrations test --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1cddad1e93201..20aac34d6f5ed 100644 --- a/Makefile +++ b/Makefile @@ -673,22 +673,22 @@ integration-test-coverage: integrations.cover.test generate-ini-mysql integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sqlite GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out -integrations.mysql.test: git-check $(GO_SOURCES) +integrations.mysql.test: git-check backend $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test -integrations.pgsql.test: git-check $(GO_SOURCES) +integrations.pgsql.test: git-check backend $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test -integrations.mssql.test: git-check $(GO_SOURCES) +integrations.mssql.test: git-check backend $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mssql.test -integrations.sqlite.test: git-check $(GO_SOURCES) +integrations.sqlite.test: git-check backend $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)' -integrations.cover.test: git-check $(GO_SOURCES) +integrations.cover.test: git-check backend $(GO_SOURCES) $(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test -integrations.cover.sqlite.test: git-check $(GO_SOURCES) +integrations.cover.sqlite.test: git-check backend $(GO_SOURCES) $(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)' .PHONY: migrations.mysql.test From ff8d0297f1b4186f2fcc5848c4bb33d6a5db633e Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 21 Mar 2024 14:14:35 +0800 Subject: [PATCH 2/3] chore: remove useless build --- .github/workflows/pull-db-tests.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 61c0391509690..61a7c34a033e5 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -46,9 +46,6 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts' - run: make deps-backend - - run: make backend - env: - TAGS: bindata - name: run migration tests run: make test-pgsql-migration - name: run tests @@ -72,9 +69,6 @@ jobs: go-version-file: go.mod check-latest: true - run: make deps-backend - - run: make backend - env: - TAGS: bindata gogit sqlite sqlite_unlock_notify - name: run migration tests run: make test-sqlite-migration - name: run tests @@ -128,9 +122,6 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts' - run: make deps-backend - - run: make backend - env: - TAGS: bindata - name: unit-tests run: make unit-test-coverage test-check env: @@ -178,9 +169,6 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts' - run: make deps-backend - - run: make backend - env: - TAGS: bindata - name: run migration tests run: make test-mysql-migration - name: run tests @@ -213,9 +201,6 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts' - run: make deps-backend - - run: make backend - env: - TAGS: bindata - run: make test-mssql-migration - name: run tests run: make test-mssql From dccc11de8b79407f3a77bb5ec8d1c288f033e9d6 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Thu, 21 Mar 2024 14:31:30 +0800 Subject: [PATCH 3/3] Revert "chore: remove useless build" This reverts commit ff8d0297f1b4186f2fcc5848c4bb33d6a5db633e. --- .github/workflows/pull-db-tests.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 61a7c34a033e5..61c0391509690 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -46,6 +46,9 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts' - run: make deps-backend + - run: make backend + env: + TAGS: bindata - name: run migration tests run: make test-pgsql-migration - name: run tests @@ -69,6 +72,9 @@ jobs: go-version-file: go.mod check-latest: true - run: make deps-backend + - run: make backend + env: + TAGS: bindata gogit sqlite sqlite_unlock_notify - name: run migration tests run: make test-sqlite-migration - name: run tests @@ -122,6 +128,9 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts' - run: make deps-backend + - run: make backend + env: + TAGS: bindata - name: unit-tests run: make unit-test-coverage test-check env: @@ -169,6 +178,9 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts' - run: make deps-backend + - run: make backend + env: + TAGS: bindata - name: run migration tests run: make test-mysql-migration - name: run tests @@ -201,6 +213,9 @@ jobs: - name: Add hosts to /etc/hosts run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts' - run: make deps-backend + - run: make backend + env: + TAGS: bindata - run: make test-mssql-migration - name: run tests run: make test-mssql