File tree Expand file tree Collapse file tree 1 file changed +38
-4
lines changed Expand file tree Collapse file tree 1 file changed +38
-4
lines changed Original file line number Diff line number Diff line change
1
+ # Integrations tests
2
+
1
3
Integration tests can be run with make commands for the
2
4
appropriate backends, namely:
3
5
4
6
make test-mysql
5
7
make test-pgsql
6
8
make test-sqlite
7
9
8
- # Running individual tests
10
+ Make sure to perform a clean build before running tests:
11
+
12
+ make clean build
13
+
14
+ ## Run all tests via local drone
15
+ ```
16
+ drone exec --local --build.event "pull_request"
17
+ ```
18
+
19
+ ## Run sqlite integrations tests
20
+ Start tests
21
+ ```
22
+ make test-sqlite
23
+ ```
24
+
25
+ ## Run mysql integrations tests
26
+ Setup a mysql database inside docker
27
+ ```
28
+ 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)
29
+ ```
30
+ Start tests based on the database container
31
+ ```
32
+ 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
33
+ ```
34
+
35
+ ## Run pgsql integrations tests
36
+ Setup a pgsql database inside docker
37
+ ```
38
+ docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
39
+ ```
40
+ Start tests based on the database container
41
+ ```
42
+ 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
43
+ ```
44
+
45
+ ## Running individual tests
9
46
10
47
Example command to run GPG test with sqlite backend:
11
48
@@ -17,6 +54,3 @@ go test -c code.gitea.io/gitea/integrations \
17
54
-test.v -test.run GPG
18
55
```
19
56
20
- Make sure to perform a clean build before running tests:
21
-
22
- make clean build
You can’t perform that action at this time.
0 commit comments