aboutsummaryrefslogtreecommitdiffstats
path: root/integrations/README.md
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2018-01-27 19:52:41 +0100
committerLauris BH <lauris@nix.lv>2018-01-27 20:52:41 +0200
commit36a94da8dab112f47ee1774f2ae9a8fd7ca21a1c (patch)
treee0ff1890313937542dff3ba498a72e838635131c /integrations/README.md
parentbcd7f42529d0d35268b1130afa3d9330b0779d6b (diff)
downloadgitea-36a94da8dab112f47ee1774f2ae9a8fd7ca21a1c.tar.gz
gitea-36a94da8dab112f47ee1774f2ae9a8fd7ca21a1c.zip
doc: Improve integrations examples (#3416)
Diffstat (limited to 'integrations/README.md')
-rw-r--r--integrations/README.md42
1 files changed, 38 insertions, 4 deletions
diff --git a/integrations/README.md b/integrations/README.md
index 25028fd2b9..64041b5469 100644
--- a/integrations/README.md
+++ b/integrations/README.md
@@ -1,3 +1,5 @@
+# Integrations tests
+
Integration tests can be run with make commands for the
appropriate backends, namely:
@@ -5,7 +7,42 @@ appropriate backends, namely:
make test-pgsql
make test-sqlite
-# Running individual tests
+Make sure to perform a clean build before running tests:
+
+ make clean build
+
+## Run all tests via local drone
+```
+drone exec --local --build.event "pull_request"
+```
+
+## Run sqlite integrations tests
+Start tests
+```
+make test-sqlite
+```
+
+## Run mysql integrations tests
+Setup a mysql database inside docker
+```
+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)
+```
+Start tests based on the database container
+```
+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
+```
+
+## Run pgsql integrations tests
+Setup a pgsql database inside docker
+```
+docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
+```
+Start tests based on the database container
+```
+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
+```
+
+## Running individual tests
Example command to run GPG test with sqlite backend:
@@ -17,6 +54,3 @@ go test -c code.gitea.io/gitea/integrations \
-test.v -test.run GPG
```
-Make sure to perform a clean build before running tests:
-
- make clean build