graphql-engine/v3/ci.docker-compose.yaml

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

58 lines
1.4 KiB
YAML
Raw Normal View History

services:
postgres:
extends:
file: ./docker-compose.yaml
service: postgres
postgres_connector:
image: ghcr.io/hasura/ndc-postgres:dev-main
ports:
- 8080:8080
environment:
CONNECTION_URI: "postgresql://postgres:password@postgres"
RUST_LOG: info
volumes:
- type: bind
source: ./crates/engine/tests/ndc-postgres-configuration
target: /etc/connector
read_only: true
depends_on:
postgres:
condition: service_healthy
custom_connector:
build:
dockerfile: custom-connector.Dockerfile
entrypoint:
- ./bin/custom-connector
ports:
Make tests run over both the ndc v0.1.x and v0.2.x custom connectors (#879) This PR updates as many tests as possible that use the custom connector so that the tests run over two versions of the custom connector: 1. The custom connector in the repo, which currently speaks `ndc_models` v0.2.x 2. The custom connector from the past (commit ), which is the last version to speak `ndc_models` v0.1.x This helps us test both the NDC v0.1.x and v0.2.x code paths. When the postgres connector upgrades to v0.2.x, we can use the same approach as in this PR to get the tests to run over multiple versions of the postgres connector too, for much better coverage. This approach with the custom connector will become less useful over time as the v0.1.x connector is not updated and will diverge in data from the v0.2.x connector. The postgres connector is likely to be longer-lasting, as it is more stable. The basic test used for `execute` integration tests is `test_execution_expectation` (in `crates/engine/tests/common.rs`) and it has been extended into a version called `test_execution_expectation_for_multiple_ndc_versions` that takes metadata on a per NDC version basis and then runs the test multiple times, once for each NDC version. This allows one to swap out the DataConnectorLink involved in the test to a different one that points at either the v0.1.x or v0.2.x versions of the connector. The assertion is that both connectors should produce the same results, even if they talk a different version of the NDC protocol. As each version runs, we `println!` the version so that if the test fails you can look in stdout for the test and see which one was executing when it failed. Tests that use the custom connector now use `test_execution_expectation_for_multiple_ndc_versions` and run across both connector versions. Some tests were unable to be used across both version as the data between the two versions has changed. Some tests were modified to avoid the changed data so as to support running across both versions. Any tests that use `test_execution_expectation_legacy` don't run across both versions because those tests aren't backed by the same test implementation as `test_execution_expectation_for_multiple_ndc_versions`. Unfortunately the custom connector doesn't use the standard connector SDK, so it doesn't support `HASURA_CONNECTOR_PORT`. This means that the old connector is stuck on 8101. To work around this, I've moved the current connector port to 8102 instead. Technically we might be able to use docker to remap the ports, but then this binds us into always running the connectors in docker in order to move their ports around, so I avoided that approach. Completes APIPG-703 V3_GIT_ORIGIN_REV_ID: fb0e410ddbee0ea699815388bc63584d6ff5dd70
2024-07-25 16:31:16 +03:00
- "8102:8102"
environment:
RUST_LOG: info
healthcheck:
Make tests run over both the ndc v0.1.x and v0.2.x custom connectors (#879) This PR updates as many tests as possible that use the custom connector so that the tests run over two versions of the custom connector: 1. The custom connector in the repo, which currently speaks `ndc_models` v0.2.x 2. The custom connector from the past (commit ), which is the last version to speak `ndc_models` v0.1.x This helps us test both the NDC v0.1.x and v0.2.x code paths. When the postgres connector upgrades to v0.2.x, we can use the same approach as in this PR to get the tests to run over multiple versions of the postgres connector too, for much better coverage. This approach with the custom connector will become less useful over time as the v0.1.x connector is not updated and will diverge in data from the v0.2.x connector. The postgres connector is likely to be longer-lasting, as it is more stable. The basic test used for `execute` integration tests is `test_execution_expectation` (in `crates/engine/tests/common.rs`) and it has been extended into a version called `test_execution_expectation_for_multiple_ndc_versions` that takes metadata on a per NDC version basis and then runs the test multiple times, once for each NDC version. This allows one to swap out the DataConnectorLink involved in the test to a different one that points at either the v0.1.x or v0.2.x versions of the connector. The assertion is that both connectors should produce the same results, even if they talk a different version of the NDC protocol. As each version runs, we `println!` the version so that if the test fails you can look in stdout for the test and see which one was executing when it failed. Tests that use the custom connector now use `test_execution_expectation_for_multiple_ndc_versions` and run across both connector versions. Some tests were unable to be used across both version as the data between the two versions has changed. Some tests were modified to avoid the changed data so as to support running across both versions. Any tests that use `test_execution_expectation_legacy` don't run across both versions because those tests aren't backed by the same test implementation as `test_execution_expectation_for_multiple_ndc_versions`. Unfortunately the custom connector doesn't use the standard connector SDK, so it doesn't support `HASURA_CONNECTOR_PORT`. This means that the old connector is stuck on 8101. To work around this, I've moved the current connector port to 8102 instead. Technically we might be able to use docker to remap the ports, but then this binds us into always running the connectors in docker in order to move their ports around, so I avoided that approach. Completes APIPG-703 V3_GIT_ORIGIN_REV_ID: fb0e410ddbee0ea699815388bc63584d6ff5dd70
2024-07-25 16:31:16 +03:00
test: curl -fsS http://localhost:8102/schema
start_period: 5s
interval: 5s
timeout: 10s
retries: 20
Make tests run over both the ndc v0.1.x and v0.2.x custom connectors (#879) This PR updates as many tests as possible that use the custom connector so that the tests run over two versions of the custom connector: 1. The custom connector in the repo, which currently speaks `ndc_models` v0.2.x 2. The custom connector from the past (commit ), which is the last version to speak `ndc_models` v0.1.x This helps us test both the NDC v0.1.x and v0.2.x code paths. When the postgres connector upgrades to v0.2.x, we can use the same approach as in this PR to get the tests to run over multiple versions of the postgres connector too, for much better coverage. This approach with the custom connector will become less useful over time as the v0.1.x connector is not updated and will diverge in data from the v0.2.x connector. The postgres connector is likely to be longer-lasting, as it is more stable. The basic test used for `execute` integration tests is `test_execution_expectation` (in `crates/engine/tests/common.rs`) and it has been extended into a version called `test_execution_expectation_for_multiple_ndc_versions` that takes metadata on a per NDC version basis and then runs the test multiple times, once for each NDC version. This allows one to swap out the DataConnectorLink involved in the test to a different one that points at either the v0.1.x or v0.2.x versions of the connector. The assertion is that both connectors should produce the same results, even if they talk a different version of the NDC protocol. As each version runs, we `println!` the version so that if the test fails you can look in stdout for the test and see which one was executing when it failed. Tests that use the custom connector now use `test_execution_expectation_for_multiple_ndc_versions` and run across both connector versions. Some tests were unable to be used across both version as the data between the two versions has changed. Some tests were modified to avoid the changed data so as to support running across both versions. Any tests that use `test_execution_expectation_legacy` don't run across both versions because those tests aren't backed by the same test implementation as `test_execution_expectation_for_multiple_ndc_versions`. Unfortunately the custom connector doesn't use the standard connector SDK, so it doesn't support `HASURA_CONNECTOR_PORT`. This means that the old connector is stuck on 8101. To work around this, I've moved the current connector port to 8102 instead. Technically we might be able to use docker to remap the ports, but then this binds us into always running the connectors in docker in order to move their ports around, so I avoided that approach. Completes APIPG-703 V3_GIT_ORIGIN_REV_ID: fb0e410ddbee0ea699815388bc63584d6ff5dd70
2024-07-25 16:31:16 +03:00
custom_connector_ndc_v01:
# This is the v3-engine commit version before the custom connector got upgraded to ndc_models v0.2.0
image: ghcr.io/hasura/v3-custom-connector:bef8a750ca31b067952247ad348683a4faa843f5
ports:
- "8101:8101"
environment:
RUST_LOG: info
# Required to test graphql-ws; subscriptions with custom session variables
auth_hook:
build:
dockerfile: dev-auth-webhook.Dockerfile
environment:
RUST_LOG: debug
ports:
- "3050:3050"
volumes:
postgres: