You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|``make test[\#TestSpecificName]``| run unit test |
89
-
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for SQLite |
90
-
|[More details about integrations](integrations/README.md)|
89
+
|``make test-sqlite[\#TestSpecificName]``| run [integration](tests/integration) test for SQLite |
90
+
|[More details about integrations](tests/integration/README.md)|
91
91
92
92
## Vendoring
93
93
@@ -167,7 +167,7 @@ import (
167
167
168
168
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
169
169
170
-
-**integration:**Integrations tests
170
+
-**integration:**Integration tests
171
171
-**models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
172
172
-**models/fixtures:** Sample model data used in integration tests.
173
173
-**models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.
Copy file name to clipboardExpand all lines: docs/content/doc/developers/guidelines-backend.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,8 @@ To maintain understandable code and avoid circular dependencies it is important
33
33
34
34
-`build`: Scripts to help build Gitea.
35
35
-`cmd`: All Gitea actual sub commands includes web, doctor, serv, hooks, admin and etc. `web` will start the web service. `serv` and `hooks` will be invoked by Git or OpenSSH. Other sub commands could help to maintain Gitea.
36
-
-`integrations`: Integration tests
36
+
-`tests`: Tests
37
+
-`tests/integration`: Integration tests
37
38
-`models`: Contains the data structures used by xorm to construct database tables. It also contains functions to query and update the database. Dependencies to other Gitea code should be avoided. You can make exceptions in cases such as logging.
38
39
-`models/db`: Basic database operations. All other `models/xxx` packages should depend on this package. The `GetEngine` function should only be invoked from `models/`.
39
40
-`models/fixtures`: Sample data used in unit tests and integration tests. One `yml` file means one table which will be loaded into database when beginning the tests.
Copy file name to clipboardExpand all lines: tests/integration/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Integrations tests
1
+
# Integration tests
2
2
3
3
Integration tests can be run with make commands for the
4
4
appropriate backends, namely:
@@ -18,13 +18,13 @@ make clean build
18
18
drone exec --local --build-event "pull_request"
19
19
```
20
20
21
-
## Run sqlite integrations tests
21
+
## Run sqlite integration tests
22
22
Start tests
23
23
```
24
24
make test-sqlite
25
25
```
26
26
27
-
## Run MySQL integrations tests
27
+
## Run MySQL integration tests
28
28
Setup a MySQL database inside docker
29
29
```
30
30
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -p 3306:3306 --rm --name mysql mysql:latest #(just ctrl-c to stop db and clean the container)
@@ -35,7 +35,7 @@ Start tests based on the database container
35
35
TEST_MYSQL_HOST=localhost:3306 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
36
36
```
37
37
38
-
## Run pgsql integrations tests
38
+
## Run pgsql integration tests
39
39
Setup a pgsql database inside docker
40
40
```
41
41
docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:latest #(just ctrl-c to stop db and clean the container)
@@ -45,7 +45,7 @@ Start tests based on the database container
45
45
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
46
46
```
47
47
48
-
## Run mssql integrations tests
48
+
## Run mssql integration tests
49
49
Setup a mssql database inside docker
50
50
```
51
51
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
44
44
```
45
45
46
-
## Run mssql integrations tests
46
+
## Run mssql integration tests
47
47
同上,首先在 docker 容器里部署一个 mssql 数据库
48
48
```
49
49
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)
0 commit comments