2023-01-16 19:42:45 +03:00
|
|
|
API_TESTS_DOCKER_COMPOSE = docker compose --project-directory=./server/lib/api-tests
|
2023-05-23 13:13:50 +03:00
|
|
|
API_TESTS_PRO_DOCKER_COMPOSE = docker compose --project-directory=./pro/server/lib/api-tests
|
2023-01-16 19:42:45 +03:00
|
|
|
PYTHON_TESTS_DOCKER_COMPOSE = docker compose --project-directory=./server/tests-py
|
|
|
|
|
2022-09-21 19:47:11 +03:00
|
|
|
# Use the Azure SQL Edge image instead of the SQL Server image on arm64.
|
|
|
|
# The latter doesn't work yet.
|
|
|
|
ifeq ($(shell uname -m),arm64)
|
|
|
|
MSSQL_IMAGE=mcr.microsoft.com/azure-sql-edge
|
2022-07-27 16:29:06 +03:00
|
|
|
else
|
2022-09-21 19:47:11 +03:00
|
|
|
MSSQL_IMAGE= # allow the Docker Compose file to set the image
|
2022-07-27 16:29:06 +03:00
|
|
|
endif
|
|
|
|
|
2022-09-21 19:47:11 +03:00
|
|
|
export MSSQL_IMAGE
|
2022-07-27 16:29:06 +03:00
|
|
|
|
2022-11-17 15:55:05 +03:00
|
|
|
TEST_MSSQL_CONNECTION_STRING = Driver={ODBC Driver 18 for SQL Server};Server=localhost,65003;Uid=sa;Pwd=Password!;Encrypt=optional
|
|
|
|
TEST_POSTGRES_URL = postgres://hasura:hasura@localhost:65002/hasura
|
|
|
|
|
2023-05-23 13:13:50 +03:00
|
|
|
.PHONY: start-api-tests-backends
|
|
|
|
## start-api-tests-backends: start all known backends in Docker and wait for them to be ready
|
|
|
|
start-api-tests-backends:
|
|
|
|
$(API_TESTS_DOCKER_COMPOSE) up --build --detach --wait
|
2022-07-27 16:29:06 +03:00
|
|
|
|
2023-05-23 13:13:50 +03:00
|
|
|
.PHONY: start-api-tests-pro-backends
|
|
|
|
## start-api-tests-pro-backends: start all known backends in Docker and wait for them to be ready
|
|
|
|
start-api-tests-pro-backends:
|
|
|
|
$(API_TESTS_PRO_DOCKER_COMPOSE) up --build --detach --wait
|
2022-07-22 13:56:03 +03:00
|
|
|
|
2023-06-14 21:38:26 +03:00
|
|
|
.PHONY: start-api-tests-pro-postgres
|
|
|
|
## start-api-tests-pro-backends: start the Postgres backend in Docker and wait for it to be ready
|
|
|
|
start-api-tests-pro-postgres:
|
|
|
|
$(API_TESTS_PRO_DOCKER_COMPOSE) up --build --detach --wait postgres
|
|
|
|
|
2022-07-22 13:56:03 +03:00
|
|
|
.PHONY: stop-everything
|
|
|
|
## stop-everything: tear down test databases
|
|
|
|
stop-everything:
|
2023-05-23 13:13:50 +03:00
|
|
|
docker compose down --volumes
|
2023-01-16 19:42:45 +03:00
|
|
|
$(API_TESTS_DOCKER_COMPOSE) down --volumes
|
2023-05-23 13:13:50 +03:00
|
|
|
$(API_TESTS_PRO_DOCKER_COMPOSE) down --volumes
|
2023-01-16 19:42:45 +03:00
|
|
|
$(PYTHON_TESTS_DOCKER_COMPOSE) down --volumes
|
2022-07-22 13:56:03 +03:00
|
|
|
|
|
|
|
.PHONY: remove-tix-file
|
|
|
|
remove-tix-file:
|
2022-10-06 12:44:49 +03:00
|
|
|
@ find . -name '*.tix' -delete
|