Skip to content

Commit 8c7ee3e

Browse files
committed
CN translation of README
1 parent fb3954f commit 8c7ee3e

File tree

2 files changed

+64
-7
lines changed

2 files changed

+64
-7
lines changed

integrations/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Integration tests can be run with make commands for the
44
appropriate backends, namely:
5-
6-
make test-mysql
7-
make test-pgsql
8-
make test-sqlite
5+
```shell
6+
make test-mysql
7+
make test-pgsql
8+
make test-sqlite
9+
```
910

1011
Make sure to perform a clean build before running tests:
11-
12-
make clean build
12+
```
13+
make clean build
14+
```
1315

1416
## Run all tests via local drone
1517
```
@@ -45,7 +47,6 @@ TEST_PGSQL_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAdd
4547
## Running individual tests
4648

4749
Example command to run GPG test with sqlite backend:
48-
4950
```
5051
go test -c code.gitea.io/gitea/integrations \
5152
-o integrations.sqlite.test -tags 'sqlite' &&

integrations/README_ZH.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# 关于集成测试
2+
3+
使用如下 make 命令可以运行指定的集成测试:
4+
```shell
5+
make test-mysql
6+
make test-pgsql
7+
make test-sqlite
8+
```
9+
10+
在执行集成测试命令前请确保清理了之前的构建环境,清理命令如下:
11+
```
12+
make clean build
13+
```
14+
15+
## 如何在本地 drone 服务器上运行所有测试
16+
```
17+
drone exec --local --build-event "pull_request"
18+
```
19+
20+
## 如何使用 sqlite 数据库进行集成测试
21+
使用该命令执行集成测试
22+
```
23+
make test-sqlite
24+
```
25+
26+
## 如何使用 mysql 数据库进行集成测试
27+
首先在docker容器里部署一个 mysql 数据库
28+
```
29+
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container)
30+
```
31+
之后便可以基于这个数据库进行集成测试
32+
```
33+
TEST_MYSQL_HOST="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql):3306" TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
34+
```
35+
36+
## 如何使用 pgsql 数据库进行集成测试
37+
同上,首先在 docker 容器里部署一个 pgsql 数据库
38+
```
39+
docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
40+
```
41+
之后便可以基于这个数据库进行集成测试
42+
```
43+
TEST_PGSQL_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql) TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
44+
```
45+
46+
## 如何进行自定义的集成测试
47+
48+
下面的示例展示了怎样基于 sqlite 数据库进行 GPG 测试:
49+
```
50+
go test -c code.gitea.io/gitea/integrations \
51+
-o integrations.sqlite.test -tags 'sqlite' &&
52+
GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" \
53+
GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test \
54+
-test.v -test.run GPG
55+
```
56+

0 commit comments

Comments
 (0)