jet/tests
markvai 0947de0628 Add the ability to use custom generic types with non std inner types
- fix #442

- Since handling all edge cases for generic type parsing is not trivial, users will specify the fields manually.
- To support more than one import per type, add an additional field for extra imports per type.

- Add examples for defining those types in the current tests that show how to define custom types.
2025-03-31 21:24:54 +03:00
..
dbconfig Add support for CockorachDB. 2022-05-05 13:01:42 +02:00
init Add retry for cockroachdb init to avoid a concurrency issue in CockroachDB, specifically a TransactionRetryError. 2024-10-29 11:53:38 +01:00
internal/utils Replace path package with filepath 2024-11-26 15:40:34 +06:00
mysql Add the ability to use custom generic types with non std inner types 2025-03-31 21:24:54 +03:00
postgres Add the ability to use custom generic types with non std inner types 2025-03-31 21:24:54 +03:00
sqlite DefaultColumns() helper on Table 2025-02-06 09:34:22 +01:00
testdata@1c501acb72 Add custom set returning function test. 2024-11-03 12:00:39 +01:00
docker-compose.yaml Synced MySQL and MariaDB version from CircleCI config 2024-11-21 18:54:00 +06:00
Makefile DefaultColumns() helper on Table 2025-02-06 09:34:22 +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