graphql-engine/scripts/make/test-infrastructure.mk
Samir Talwar 2467e23ef6 docker: Always use the official SQL Server image for testing.
Now that Docker for macOS supports using Rosetta for x86/amd64 emulation, we no longer need to use the `azure-sql-edge` image. We can always use the official `mcr.microsoft.com/mssql/server` one.

This also means that we no longer need the separate healthcheck container, because the official image ships with `sqlcmd`.

When this is merged, you will need to ensure you have enabled Rosetta emulation in the Docker settings to test against SQL Server on macOS. This requires macOS 13 (Ventura).

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10139
GitOrigin-RevId: 2225bf5f4c6d3632da1f29b2229c9b04ead5e34c
2023-09-25 13:27:23 +00:00

34 lines
1.5 KiB
Makefile

API_TESTS_DOCKER_COMPOSE = docker compose --project-directory=./server/lib/api-tests
API_TESTS_PRO_DOCKER_COMPOSE = docker compose --project-directory=./pro/server/lib/api-tests
PYTHON_TESTS_DOCKER_COMPOSE = docker compose --project-directory=./server/tests-py
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
.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
.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
.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
.PHONY: stop-everything
## stop-everything: tear down test databases
stop-everything:
docker compose down # don't discard volumes used for manual testing
$(API_TESTS_DOCKER_COMPOSE) down --volumes
$(API_TESTS_PRO_DOCKER_COMPOSE) down --volumes
$(PYTHON_TESTS_DOCKER_COMPOSE) down --volumes
.PHONY: remove-tix-file
remove-tix-file:
@ find . -name '*.tix' -delete