graphql-engine/server/tests-py/docker-compose.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

111 lines
3.2 KiB
YAML
Raw Normal View History

# These services are brought up in 'run.sh' (see that file)
version: "3.6"
name: hge-python-tests
services:
cabal-update:
image: hasura/graphql-engine-server-builder:${DOCKER_PLATFORM:-}-${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:${DOCKER_PLATFORM:-}-${HASURA_GRAPHQL_ENGINE_SERVER_BUILDER_SHA}
command:
- sh
- -c
- |
set -ex
cabal build graphql-engine:exe:graphql-engine
cabal list-bin graphql-engine:exe:graphql-engine > dist-newstyle/bin.txt
volumes:
- ../..:/src
- /dev/null:/src/cabal.project.local # don't include cabal.project.local in build
- 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:
- sh
- -c
- |
set -ex
export GRAPHQL_ENGINE="$$(cat dist-newstyle/bin.txt)"
./oss-.circleci/test-server.sh
environment:
- CIRCLE_NODE_INDEX=1
- CIRCLE_NODE_TOTAL=1
- OUTPUT_FOLDER=/output
- HASURA_GRAPHQL_DATABASE_URL=postgresql://postgres:hasura@hge-python-tests-postgres-1/postgres
- HASURA_GRAPHQL_DATABASE_URL_2=postgresql://postgres:hasura@hge-python-tests-postgres-2/postgres
- HASURA_GRAPHQL_CITUS_SOURCE_URL=postgresql://postgres:hasura@citus/postgres
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
- HASURA_GRAPHQL_MSSQL_SOURCE_URL=DRIVER={ODBC Driver 18 for SQL Server};SERVER=sqlserver,1433;Uid=sa;Pwd=Password!;Encrypt=optional
- HASURA_GRAPHQL_PG_SOURCE_URL_1=postgresql://postgres:hasura@hge-python-tests-postgres-1/postgres
- HASURA_GRAPHQL_PG_SOURCE_URL_2=postgresql://postgres:hasura@hge-python-tests-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:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
postgres:
condition: service_healthy
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
citus:
condition: service_healthy
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
sqlserver-healthcheck:
condition: service_healthy
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
postgres:
extends:
file: ../../docker-compose/databases.yaml
service: postgres
environment:
POSTGRES_PASSWORD: "hasura"
volumes:
- ./docker/postgres-init.sh:/docker-entrypoint-initdb.d/init.sh:ro
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
deploy:
replicas: 2
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
citus:
extends:
file: ../../docker-compose/databases.yaml
service: citus
environment:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
POSTGRES_PASSWORD: "hasura"
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
sqlserver:
extends:
file: ../../docker-compose/databases.yaml
service: sqlserver
sqlserver-healthcheck:
extends:
file: ../../docker-compose/databases.yaml
service: sqlserver-healthcheck
depends_on:
Share database configuration across tests. This enables sharing the Docker Compose-based database configuration across the Haskell-based API tests and the legacy Python integration tests. Why? Because we depend on different database versions and I keep running out of disk space. I am far too lazy to buy another disk and set up my operating system _again_. The files in question are: - _docker-compose/databases.yaml_, which is the base specification for the databases - _docker-compose.yml_, used by the API tests locally (and for other manual testing), which extends the above - _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, used by the API tests in CI, which extends _databases.yaml_ - _server/tests-py/docker-compose.yml_, used by the Python integration tests The changes are summarized as follows: 1. The following snippets are moved from _docker-compose/databases.yaml_ to _docker-compose.yml_ and _.buildkite/docker-compose-files/test-oss-server-hspec.yml_, as they're not strictly necessary for other forms of testing: - the fixed port mappings (in the range 65000–65010) - the PostgreSQL initialization - the SQL Server initialization 2. Environment variables are used a little more in health checks and initialization scripts, as usernames, passwords, etc. can be overridden. 3. The volumes in _docker-compose/databases.yaml_ are made anonymous (unnamed), and the names are only specified in _docker-compose.yml_. We don't need to do this elsewhere. - For extra fun, I have removed all named volumes from the CI Docker Compose files, as they seem to be unnecessary. 4. _server/tests-py/docker-compose.yml_ now depends on _docker-compose/databases.yaml_. - This was the point. PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6864 GitOrigin-RevId: f22f2839716f543ce8a62f890da244de7e23abaa
2022-11-15 17:31:20 +03:00
sqlserver:
condition: service_started
volumes:
cabal-cache:
hge-dist:
output: