jet/tests
Eli Ribble 9f722d9c05
Don't 'install' jet during tests
Build the output and reference it directly.

Also, use real Makefile syntax for a dependency on a built file to have
proper dependency tracking for updating files
2026-05-14 15:58:39 +00:00
..
dbconfig Bulk replace project references in go code 2026-05-09 01:43:40 +00:00
init Bulk replace project references in go code 2026-05-09 01:43:40 +00:00
internal/utils Replace path package with filepath 2024-11-26 15:40:34 +06:00
mysql Bulk replace project references in go code 2026-05-09 01:43:40 +00:00
postgres Bulk replace project references in go code 2026-05-09 01:43:40 +00:00
sqlite Bulk replace project references in go code 2026-05-09 01:43:40 +00:00
testdata@5003c4883c Add cockroachdb table comments. 2026-02-03 12:43:37 +01:00
docker-compose.yaml Switch from docker to podman 2026-05-14 15:46:06 +00:00
go.mod Update dependencies. 2026-05-03 12:10:07 +02:00
go.sum Update dependencies. 2026-05-03 12:10:07 +02:00
Makefile Don't 'install' jet during tests 2026-05-14 15:58:39 +00:00
Readme.md Update circle.ci 2021-12-19 18:25:55 +01:00

Integration tests

This folder contains integration tests intended to test jet generator, statements and query result mapping with a running database.

How to run tests?

Before we can run tests, we need to set up and initialize test databases. To simplify the process there is a Makefile with a list of helper commands.

# We first need to checkout testdata from separate repository into git submodule,
# then download docker image for each of the databases listed in docker-compose.yaml file, and 
# finally run and initialize databases with downloaded test data.
# Note that on the first run this command might take a couple of minutes.
make setup

# When databases are ready, we can generate sql builder and model types for each of the test databases
make jet-gen-all

Then we can run the tests the usual way:

go test -v ./...

To removes test containers, volumes, and images:

make cleanup