mirror of
https://github.com/xorcare/testing-go-code-with-postgres.git
synced 2024-12-24 16:28:34 +02:00
The example suggests a solution to the problem of cleaning the database after running tests and the problem of running tests in parallel. It also shows how to organize integration testing of Go code with Postgres.
42815eab15
Added an example .gitlab-ci.yml, to make a sample more informative. Also added mirroring to gitlab to simplify repository development and gitlab ci validation. |
||
---|---|---|
.github/workflows | ||
migrations | ||
testingpg | ||
.editorconfig | ||
.gitignore | ||
.gitlab-ci.yml | ||
.golangci.yml | ||
docker-compose.yml | ||
docker-multiple-databases.sh | ||
go.mod | ||
go.sum | ||
LICENSE | ||
Makefile | ||
README.md | ||
user_model.go | ||
user_repository_test.go | ||
user_repository.go |
Example of testing Go code with Postgres
The example suggests a solution to the problem of cleaning the database after running tests and the problem of running tests in parallel. It also shows how to organize integration testing of Go code with Postgres.
How to use
Run make test-env-up test
and then everything will happen by itself.
Disclaimer
This example is not an example of software architecture!