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