Преглед изворни кода

doc: Improve integrations examples (#3416)

tags/v1.4.0-rc1
Antoine GIRARD пре 6 година
родитељ
комит
36a94da8da
1 измењених фајлова са 38 додато и 4 уклоњено
  1. 38
    4
      integrations/README.md

+ 38
- 4
integrations/README.md Прегледај датотеку

# Integrations tests

Integration tests can be run with make commands for the Integration tests can be run with make commands for the
appropriate backends, namely: appropriate backends, namely:


make test-pgsql make test-pgsql
make test-sqlite 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: Example command to run GPG test with sqlite backend:


-test.v -test.run GPG -test.v -test.run GPG
``` ```


Make sure to perform a clean build before running tests:

make clean build

Loading…
Откажи
Сачувај