dev-integration-tests: update database steps (just use docker)

Signed-off-by: 's avatarStephan Renatus <srenatus@chef.io>
parent 1d0568ef
......@@ -18,39 +18,28 @@ $ ./scripts/test-k8s.sh
## Postgres
Running database tests locally require:
Running database tests locally requires:
* A systemd based Linux distro.
* A recent version of [rkt](https://github.com/coreos/rkt) installed.
* Docker
The `standup.sh` script in the SQL directory is used to run databases in containers with systemd daemonizing the process.
To run the database integration tests:
```
$ sudo ./storage/sql/standup.sh create postgres
Starting postgres. To view progress run
journalctl -fu dex-postgres
- start a postgres container:
Running as unit dex-postgres.service.
To run tests export the following environment variables:
`docker run --name dex-postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=dex -p 5432:5432 -d postgres:11`
- export the required environment variables:
export DEX_POSTGRES_DATABASE=postgres; export DEX_POSTGRES_USER=postgres; export DEX_POSTGRES_PASSWORD=postgres; export DEX_POSTGRES_HOST=172.16.28.3:5432
`export DEX_POSTGRES_DATABASE=dex DEX_POSTGRES_USER=postgres DEX_POSTGRES_PASSWORD=postgres DEX_POSTGRES_HOST=127.0.0.1:5432`
```
- run the storage/sql tests:
Exporting the variables will cause the database tests to be run, rather than skipped.
```
$ # sqlite3 takes forever to compile, be sure to install test dependencies
$ go test -v -i ./storage/sql
$ go test -v ./storage/sql
```
```
$ # sqlite3 takes forever to compile, be sure to install test dependencies
$ go test -v -i ./storage/sql
$ go test -v ./storage/sql
```
When you're done, tear down the unit using the `standup.sh` script.
```
$ sudo ./storage/sql/standup.sh destroy postgres
```
- clean up the postgres container: `docker rm -f dex-postgres`
## LDAP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment