We use conventional commits (also known as semantic commits) to ensure consistent and descriptive commit messages.
# requires docker to be installed
go run ./test/setup/init setup # sets up docker containers for integration testing
go generate ./...
go test ./... -v
# to teardown docker containers:
go run ./test/setup/init teardown
Most test live in the test/
directory and are integration tests of the generated client. That means there's a Prisma
schema and before running the test, the client needs to be generated first. There may be table-driven tests which, on
each individual test run, creates a new isolated database, runs migrations, then run the tests, and finally cleans up
the database afterwards.
You can also run individual code generation tests via your editor, however keep in mind you need to run
go generate ./...
before in the directory of the tests you want to run.
End-to-end tests require third party credentials and may also be flaky from time to time. This is why they are not run locally by default and optional in CI.
To run them locally, you need to set up all required credentials (check the env vars used for CI, and then run:
cd test/e2e/
go generate -tags e2e ./...
go test ./... -run '^TestE2E.*$' -tags e2e -v