2023-12-19 12:04:02 +03:00
|
|
|
services:
|
|
|
|
postgres:
|
2024-04-22 16:42:32 +03:00
|
|
|
extends:
|
|
|
|
file: ./docker-compose.yaml
|
|
|
|
service: postgres
|
2024-03-12 18:26:31 +03:00
|
|
|
|
2023-12-19 12:04:02 +03:00
|
|
|
postgres_connector:
|
2024-04-03 11:03:18 +03:00
|
|
|
image: ghcr.io/hasura/ndc-postgres:dev-main
|
2024-03-12 18:26:31 +03:00
|
|
|
ports:
|
2024-04-03 14:50:56 +03:00
|
|
|
- 8080:8080
|
2024-04-03 11:03:18 +03:00
|
|
|
environment:
|
|
|
|
CONNECTION_URI: "postgresql://postgres:password@postgres"
|
2024-10-03 11:48:52 +03:00
|
|
|
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://jaeger:4317"
|
|
|
|
OTEL_SERVICE_NAME: "ndc-postgres"
|
2024-05-14 18:10:42 +03:00
|
|
|
RUST_LOG: info
|
2023-12-19 12:04:02 +03:00
|
|
|
volumes:
|
2024-04-03 11:03:18 +03:00
|
|
|
- type: bind
|
|
|
|
source: ./crates/engine/tests/ndc-postgres-configuration
|
|
|
|
target: /etc/connector
|
|
|
|
read_only: true
|
2023-12-19 12:04:02 +03:00
|
|
|
depends_on:
|
|
|
|
postgres:
|
|
|
|
condition: service_healthy
|
2024-03-12 18:26:31 +03:00
|
|
|
|
2023-12-19 12:04:02 +03:00
|
|
|
custom_connector:
|
|
|
|
build:
|
2024-07-24 16:40:46 +03:00
|
|
|
dockerfile: custom-connector.Dockerfile
|
2024-03-21 19:48:53 +03:00
|
|
|
entrypoint:
|
2024-04-22 16:42:32 +03:00
|
|
|
- ./bin/custom-connector
|
2024-03-12 18:26:31 +03:00
|
|
|
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"
|
2024-05-14 18:10:42 +03:00
|
|
|
environment:
|
|
|
|
RUST_LOG: info
|
2023-12-19 12:04:02 +03:00
|
|
|
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
|
2023-12-19 12:04:02 +03:00
|
|
|
start_period: 5s
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 20
|
2024-03-12 18:26:31 +03:00
|
|
|
|
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
|
|
|
|
|
2024-10-03 07:21:55 +03:00
|
|
|
# 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"
|
|
|
|
|
2023-12-19 12:04:02 +03:00
|
|
|
volumes:
|
|
|
|
postgres:
|