Skip to content

Commit 6959915

Browse files
committed
update init
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 310a5f7 commit 6959915

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

Makefile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,39 +169,41 @@ test-vendor:
169169
test-sqlite: integrations.sqlite.test
170170
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
171171

172-
.PHONY: test-mysql
173-
test-mysql: integrations.mysql.test
172+
generate-ini:
174173
sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
175-
-e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
176-
-e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
177-
-e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
178-
integrations/mysql.ini.tmpl > integrations/mysql.ini
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
178+
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
179+
-e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
180+
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
181+
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
182+
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
183+
184+
.PHONY: test-mysql
185+
test-mysql: integrations.mysql.test generate-ini
179186
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
180187

181188
.PHONY: test-pgsql
182-
test-pgsql: integrations.pgsql.test
183-
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
184-
-e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
185-
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
186-
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
187-
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
189+
test-pgsql: integrations.pgsql.test generate-ini
188190
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
189191

190192
.PHONY: bench-sqlite
191193
bench-sqlite: integrations.sqlite.test
192194
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.bench .
193195

194196
.PHONY: bench-mysql
195-
bench-mysql: integrations.mysql.test
197+
bench-mysql: integrations.mysql.test generate-ini
196198
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.bench .
197199

198200
.PHONY: bench-pgsql
199-
bench-pgsql: integrations.pgsql.test
201+
bench-pgsql: integrations.pgsql.test generate-ini
200202
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.bench .
201203

202204

203205
.PHONY: integration-test-coverage
204-
integration-test-coverage: integrations.cover.test
206+
integration-test-coverage: integrations.cover.test generate-ini
205207
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
206208

207209
integrations.mysql.test: $(SOURCES)

0 commit comments

Comments
 (0)