diff options
author | zeripath <art27@cantab.net> | 2019-01-28 16:18:52 +0000 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-01-28 11:18:52 -0500 |
commit | 8917d66571a95f3da232a0c27bc1300210d10fde (patch) | |
tree | 8ec9c1e03b9109a9ceea66b1f384582d16e206e4 /Makefile | |
parent | bc748f205afd2aa8a3243ff6170298f0194732df (diff) | |
download | gitea-8917d66571a95f3da232a0c27bc1300210d10fde.tar.gz gitea-8917d66571a95f3da232a0c27bc1300210d10fde.zip |
Add migration test (#5773)
* Add migration test
This commit adds a simple migration test for v1.5.3, v1.6.4 and v1.7.0-rc3
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Automigrate based on available dbs
* remove old ini file
* Standardise the dialect names
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -35,7 +35,7 @@ endif LDFLAGS := -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)" -PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/)) +PACKAGES ?= $(filter-out code.gitea.io/gitea/integrations/migration-test,$(filter-out code.gitea.io/gitea/integrations,$(shell $(GO) list ./... | grep -v /vendor/))) SOURCES ?= $(shell find . -name "*.go" -type f) TAGS ?= @@ -197,6 +197,10 @@ test-vendor: vendor test-sqlite: integrations.sqlite.test GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test +.PHONY: test-sqlite-migration +test-sqlite-migration: migrations.sqlite.test + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test + generate-ini: sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \ -e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \ @@ -218,14 +222,28 @@ generate-ini: test-mysql: integrations.test generate-ini GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test +.PHONY: test-mysql-migration +test-mysql-migration: migrations.test generate-ini + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./migrations.test + .PHONY: test-pgsql test-pgsql: integrations.test generate-ini GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test +.PHONY: test-pgsql-migration +test-pgsql-migration: migrations.test generate-ini + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./migrations.test + + .PHONY: test-mssql test-mssql: integrations.test generate-ini GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test +.PHONY: test-mssql-migration +test-mssql-migration: migrations.test generate-ini + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.test + + .PHONY: bench-sqlite bench-sqlite: integrations.sqlite.test GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench . @@ -252,6 +270,14 @@ integrations.sqlite.test: $(SOURCES) integrations.cover.test: $(SOURCES) $(GO) test -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test +.PHONY: migrations.test +migrations.test: $(SOURCES) + $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.test + +.PHONY: migrations.sqlite.test +migrations.sqlite.test: $(SOURCES) + $(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.sqlite.test -tags 'sqlite sqlite_unlock_notify' + .PHONY: check check: test |