graphql-engine/server/tests-py/docker-compose.yml
Samir Talwar 60f81023db server/tests-py: Run the auth hook inside the test harness.
This teaches `hge_server` how to run more tests, thanks to `hge_env`.

It also simplifies the logic a bit more.

I have also modified _run.sh_ and _docker-compose.yml_ so we can run multiple test suites, one after another.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6105
GitOrigin-RevId: eff009362eb6bb90c07cedaf96dfe6ec9336ff32
2022-09-29 10:44:03 +00:00

150 lines
4.4 KiB
YAML

# These services are brought up in 'run.sh' (see that file)
version: "3.6"
services:
cabal-update:
image: hasura/graphql-engine-server-builder:${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- cabal
- update
volumes:
- .:/src
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
hge-build:
image: hasura/graphql-engine-server-builder:${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- cabal
- build
- graphql-engine:exe:graphql-engine
volumes:
- ../..:/src
- hge-dist:/src/dist-newstyle
- cabal-cache:/root/.cabal
working_dir: /src
depends_on:
cabal-update:
condition: service_completed_successfully
tests-py:
build:
context: ../..
dockerfile: ./.buildkite/dockerfiles/server-pytest-runner/Dockerfile
image: hasura/graphql-engine-server-pytest-runner:${HASURA_GRAPHQL_ENGINE_SERVER_PYTEST_RUNNER_SHA}
command:
- ./oss-.circleci/test-server.sh
environment:
- CIRCLE_NODE_INDEX=1
- CIRCLE_NODE_TOTAL=1
- OUTPUT_FOLDER=/output
- GRAPHQL_ENGINE=/src/dist-newstyle/build/x86_64-linux/ghc-8.10.7/graphql-engine-1.0.0/x/graphql-engine/noopt/build/graphql-engine/graphql-engine
- HASURA_GRAPHQL_DATABASE_URL=postgresql://postgres:hasura@tests-py-postgres-1/postgres
- HASURA_GRAPHQL_DATABASE_URL_2=postgresql://postgres:hasura@tests-py-postgres-2/postgres
- HASURA_GRAPHQL_CITUS_SOURCE_URL=postgresql://postgres:hasura@citus/postgres
- HASURA_GRAPHQL_MSSQL_SOURCE_URL=DRIVER={ODBC Driver 17 for SQL Server};SERVER=mssql,1433;Uid=sa;Pwd=Password!;
- HASURA_GRAPHQL_PG_SOURCE_URL_1=postgresql://postgres:hasura@tests-py-postgres-1/postgres
- HASURA_GRAPHQL_PG_SOURCE_URL_2=postgresql://postgres:hasura@tests-py-postgres-2/postgres
- HASURA_BIGQUERY_PROJECT_ID
- HASURA_BIGQUERY_SERVICE_KEY
- SERVER_TEST_TO_RUN
volumes:
- ../..:/src
- hge-dist:/src/dist-newstyle
- output:/output
working_dir: /src
depends_on:
citus:
condition: service_healthy
mssql-healthcheck:
condition: service_healthy
postgres:
condition: service_healthy
citus:
image: citusdata/citus:10.1@sha256:7e497e5ca18d7f2ae2a66c1d5d676b548e9221b7e6294adfb03006adad85502c
ports:
- 5432
environment:
POSTGRES_PASSWORD: "hasura"
healthcheck:
test:
- CMD-SHELL
- psql -U postgres < /dev/null && sleep 5 && psql -U postgres < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
volumes:
- /var/lib/postgresql/data
mssql:
# Uses a different image for arm64.
image: ${MSSQL_IMAGE:-mcr.microsoft.com/mssql/server:2019-latest@sha256:a098c9ff6fbb8e1c9608ad7511fa42dba8d22e0d50b48302761717840ccc26af}
ports:
- 1433
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "Password!"
MSSQL_SA_PASSWORD: "Password!"
volumes:
- /var/opt/mssql
# This is necessary because on macOS on amd64, the `mssql/server` image is not available.
# We use the `azure-sql-edge` image instead, which does not ship with `sqlcmd` on amd64.
mssql-healthcheck:
image: mcr.microsoft.com/mssql-tools
command:
- sleep
- inf
init: true # handle signals correctly
healthcheck:
test:
- CMD-SHELL
- |
/opt/mssql-tools/bin/sqlcmd -S 'mssql,1433' -U SA -P "Password!"
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
depends_on:
mssql:
condition: service_started
postgres:
image: cimg/postgres:14.4-postgis@sha256:492a389895568e2f89a03c0c45c19350888611001123514623551a014e83a625
command:
- -F # turn fsync off for speed
- -N 1000 # increase max connections from 100 so we can run more HGEs
ports:
- 5432
environment:
POSTGRES_PASSWORD: "hasura"
healthcheck:
test:
- CMD-SHELL
- psql -U postgres < /dev/null && sleep 5 && psql -U postgres < /dev/null
start_period: 5s
interval: 5s
timeout: 10s
retries: 10
volumes:
- /var/lib/postgresql/data
deploy:
replicas: 2
postgres-healthy:
image: busybox
command:
- 'true'
depends_on:
postgres:
condition: service_healthy
volumes:
cabal-cache:
hge-dist:
output: