@@ -32,6 +32,15 @@ TAGS ?=
32
32
33
33
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'gitea-temp')
34
34
35
+ TEST_MYSQL_HOST ?= mysql:3306
36
+ TEST_MYSQL_DBNAME ?= testgitea
37
+ TEST_MYSQL_USERNAME ?= root
38
+ TEST_MYSQL_PASSWORD ?=
39
+ TEST_PGSQL_HOST ?= pgsql:5432
40
+ TEST_PGSQL_DBNAME ?= testgitea
41
+ TEST_PGSQL_USERNAME ?= postgres
42
+ TEST_PGSQL_PASSWORD ?= postgres
43
+
35
44
ifeq ($(OS ) , Windows_NT)
36
45
EXECUTABLE := gitea.exe
37
46
else
@@ -54,7 +63,7 @@ all: build
54
63
.PHONY : clean
55
64
clean :
56
65
$(GO ) clean -i ./...
57
- rm -rf $(EXECUTABLE ) $(DIST ) $(BINDATA ) integrations* .test integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-sqlite/
66
+ rm -rf $(EXECUTABLE ) $(DIST ) $(BINDATA ) integrations* .test integrations/gitea-integration-pgsql/ integrations/gitea-integration-mysql/ integrations/gitea-integration-sqlite/ integrations/mysql.ini integrations/pgsql.ini
58
67
59
68
required-gofmt-version :
60
69
@$(GO ) version | grep -q ' \(1.7\|1.8\)' || { echo " We require go version 1.7 or 1.8 to format code" >&2 && exit 1; }
@@ -161,13 +170,22 @@ test-sqlite: integrations.sqlite.test
161
170
162
171
.PHONY : test-mysql
163
172
test-mysql : integrations.mysql.test
173
+ sed -e ' s|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
174
+ -e ' s|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
175
+ -e ' s|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
176
+ -e ' s|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
177
+ integrations/mysql.ini.tmpl > integrations/mysql.ini
164
178
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
165
179
166
180
.PHONY : test-pgsql
167
181
test-pgsql : integrations.pgsql.test
182
+ sed -e ' s|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
183
+ -e ' s|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
184
+ -e ' s|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
185
+ -e ' s|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
186
+ integrations/pgsql.ini.tmpl > integrations/pgsql.ini
168
187
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
169
188
170
-
171
189
.PHONY : bench-sqlite
172
190
bench-sqlite : integrations.sqlite.test
173
191
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.bench .
0 commit comments