jet/tests
go-jet 01305a138f Add automatic type cast for integer literals
In parameterized statements integer literals, like Int(num), are replaced with a placeholders. For some expressions,
postgres interpreter will not have enough information to deduce the type. If this is the case postgres returns an error.
Int8, Int16, Int32.... functions now will add automatic type cast over a placeholder, so type deduction is always possible.
2021-12-26 17:29:43 +01:00
..
dbconfig Update circle.ci 2021-12-19 18:25:55 +01:00
init Update circle.ci 2021-12-19 18:25:55 +01:00
internal/utils Add SQLBuilder support for SQLite databases. 2021-10-21 13:40:26 +02:00
mysql Add support for running integration tests with dockerized test databases. 2021-12-17 16:59:43 +01:00
postgres Add automatic type cast for integer literals 2021-12-26 17:29:43 +01:00
sqlite Add FROM clause support for UPDATE statements 2021-12-08 18:13:58 +01:00
testdata@f8329498fd Add support for running integration tests with dockerized test databases. 2021-12-17 16:59:43 +01:00
docker-compose.yaml Update circle.ci 2021-12-19 18:25:55 +01:00
Makefile Update circle.ci 2021-12-19 18:25:55 +01: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