You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
658 B

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