2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE_PATH = $( shell cabal list-bin exe:graphql-engine)
GRAPHQL_ENGINE_PRO_PATH = $( shell cabal list-bin exe:graphql-engine-pro)
2022-06-20 16:33:04 +03:00
.PHONY : test -bigquery
## test-bigquery: run tests for BigQuery backend
2022-10-04 11:30:09 +03:00
# will require some setup detailed here: https://github.com/hasura/graphql-engine-mono/tree/main/server/lib/api-tests#required-setup-for-bigquery-tests
2023-01-03 17:03:35 +03:00
test-bigquery : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres
2022-07-22 13:56:03 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = BigQuery \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-06-20 16:33:04 +03:00
.PHONY : test -sqlserver
2022-11-17 15:55:05 +03:00
## test-sqlserver: run tests for MS SQL Server backend
2023-01-03 17:03:35 +03:00
test-sqlserver : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres sqlserver-healthcheck
2022-07-22 13:56:03 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = SQLServer \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-06-20 16:33:04 +03:00
2022-08-03 14:05:59 +03:00
.PHONY : test -citus
## test-citus: run tests for Citus backend
2023-01-03 17:03:35 +03:00
test-citus : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres citus
2022-08-03 14:05:59 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = Citus \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-08-03 14:05:59 +03:00
2022-08-25 15:08:07 +03:00
.PHONY : test -data -connectors
## test-data-connectors: run tests for Data Connectors
2023-01-03 17:03:35 +03:00
test-data-connectors : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) build
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres dc-reference-agent dc-sqlite-agent
2022-08-25 15:08:07 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = DataConnector \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-08-25 15:08:07 +03:00
2022-08-25 20:17:28 +03:00
.PHONY : test -cockroach
## test-cockroach: run tests for Cockroach backend
2023-01-03 17:03:35 +03:00
test-cockroach : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres cockroach
2022-08-25 20:17:28 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = Cockroach \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-08-25 20:17:28 +03:00
2022-11-01 18:17:45 +03:00
.PHONY : test -postgres
## test-postgres: run tests for Postgres backend
2022-11-18 01:34:02 +03:00
# we have a few tests labeled with 'Postgres' which test their variants, too,
# so this also starts containers for Postgres variants
2023-01-03 17:03:35 +03:00
test-postgres : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres cockroach citus dc-sqlite-agent
2022-11-01 18:17:45 +03:00
$( call stop_after, \
2022-11-25 18:07:57 +03:00
HASURA_TEST_BACKEND_TYPE = Postgres \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-11-25 18:07:57 +03:00
.PHONY : test -no -backends
## test-no-backends
# the leftover tests with no particular backend, like Remote Schemas
2023-01-03 17:03:35 +03:00
test-no-backends : build start -backends remove -tix -file
2022-11-25 18:07:57 +03:00
$( call stop_after, \
HASURA_TEST_BACKEND_TYPE = None \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-11-01 18:17:45 +03:00
2022-06-20 16:33:04 +03:00
.PHONY : test -backends
## test-backends: run tests for all backends
2022-10-04 11:30:09 +03:00
# BigQuery tests will require some setup detailed here: https://github.com/hasura/graphql-engine-mono/tree/main/server/lib/api-tests#required-setup-for-bigquery-tests
2023-01-03 17:03:35 +03:00
test-backends : build start -backends remove -tix -file
2022-07-22 13:56:03 +03:00
$( call stop_after, \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-13 15:36:03 +03:00
cabal run api-tests:exe:api-tests)
2022-12-12 20:44:47 +03:00
.PHONY : test -matrix
## test-matrix: postgres test matrix generator
2023-01-03 17:03:35 +03:00
test-matrix : build remove -tix -file
2023-01-16 19:42:45 +03:00
$( API_TESTS_DOCKER_COMPOSE) up -d --wait postgres cockroach citus dc-sqlite-agent
2022-12-12 20:44:47 +03:00
$( call stop_after, \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PATH) \
2022-12-12 20:44:47 +03:00
cabal run api-tests:exe:produce-feature-matrix +RTS -N4 -RTS)
2022-08-19 14:22:28 +03:00
2022-12-14 06:46:10 +03:00
.PHONY : test -backends -pro
## test-backends-pro: run tests for HGE pro for all backends
2023-01-03 17:03:35 +03:00
test-backends-pro : build -pro start -backends remove -tix -file
2022-12-14 06:46:10 +03:00
$( call stop_after, \
2023-01-03 17:03:35 +03:00
GRAPHQL_ENGINE = $( GRAPHQL_ENGINE_PRO_PATH) \
2022-12-14 06:46:10 +03:00
cabal run api-tests-pro:exe:api-tests-pro)
2022-08-19 14:22:28 +03:00
.PHONY : test -unit
## test-unit: run unit tests from main suite
test-unit : remove -tix -file
2022-11-17 15:55:05 +03:00
cabal run graphql-engine:test:graphql-engine-tests
.PHONY : test -integration -mssql
## test-integration-mssql: run MS SQL Server integration tests
test-integration-mssql : remove -tix -file
docker compose up -d --wait sqlserver{ ,-healthcheck,-init}
$( call stop_after, \
HASURA_MSSQL_CONN_STR = '$(TEST_MSSQL_CONNECTION_STRING)' \
cabal run graphql-engine:test:graphql-engine-test-mssql)
.PHONY : test -integration -postgres
## test-integration-postgres: run PostgreSQL integration tests
test-integration-postgres : remove -tix -file
docker compose up -d --wait postgres
$( call stop_after, \
HASURA_GRAPHQL_DATABASE_URL = '$(TEST_POSTGRES_URL)' \
cabal run graphql-engine:test:graphql-engine-test-postgres)
2022-12-07 17:11:43 +03:00
.PHONY : py -tests
## py-tests: run the python-based test suite
py-tests :
$( call stop_after, \
./server/tests-py/run-new.sh)