本站源代码
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

658B

Tests

Running Tests

go test is used for testing. A running PostgreSQL server is required, with the ability to log in. The database to connect to test with is “pqgotest,” on “localhost” but these can be overridden using environment variables.

Example:

PGHOST=/run/postgresql go test

Benchmarks

A benchmark suite can be run as part of the tests:

go test -bench .

Example setup (Docker)

Run a postgres container:

docker run --expose 5432:5432 postgres

Run tests:

PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test
上海开阖软件有限公司 沪ICP备12045867号-1