source: code/trunk/vendor/github.com/lib/pq/TESTS.md@ 822

Last change on this file since 822 was 822, checked in by yakumo.izuru, 22 months ago

Prefer immortal.run over runit and rc.d, use vendored modules
for convenience.

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 658 bytes
Line 
1# Tests
2
3## Running Tests
4
5`go test` is used for testing. A running PostgreSQL
6server is required, with the ability to log in. The
7database to connect to test with is "pqgotest," on
8"localhost" but these can be overridden using [environment
9variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html).
10
11Example:
12
13 PGHOST=/run/postgresql go test
14
15## Benchmarks
16
17A benchmark suite can be run as part of the tests:
18
19 go test -bench .
20
21## Example setup (Docker)
22
23Run a postgres container:
24
25```
26docker run --expose 5432:5432 postgres
27```
28
29Run tests:
30
31```
32PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test
33```
Note: See TracBrowser for help on using the repository browser.