-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add meaningful acceptance test configs
- Loading branch information
Showing
10 changed files
with
2,173 additions
and
2 deletions.
There are no files selected for viewing
48 changes: 46 additions & 2 deletions
48
airbyte-integrations/connectors/source-postgres-strict-encrypt/acceptance-test-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,50 @@ | ||
# See [Connector Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/connector-acceptance-tests-reference) | ||
# for more information about how to configure these tests | ||
connector_image: airbyte/source-postgres-strict-encrypt:dev | ||
tests: | ||
custom_environment_variables: | ||
USE_STREAM_CAPABLE_STATE: true | ||
acceptance_tests: | ||
spec: | ||
- spec_path: "src/test/resources/expected_spec.json" | ||
tests: | ||
- spec_path: "src/test-integration/resources/expected_strict_encrypt_spec.json" | ||
config_path: "secrets/config.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: "1.0.52" | ||
- spec_path: "src/test-integration/resources/expected_strict_encrypt_spec.json" | ||
config_path: "secrets/config_cdc.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: "1.0.52" | ||
connection: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
status: "succeed" | ||
- config_path: "secrets/config_cdc.json" | ||
status: "succeed" | ||
discovery: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
- config_path: "secrets/config_cdc.json" | ||
backward_compatibility_tests_config: | ||
disable_for_version: "2.1.1" | ||
basic_read: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
expect_records: | ||
path: "integration_tests/expected_records.txt" | ||
- config_path: "secrets/config_cdc.json" | ||
expect_records: | ||
path: "integration_tests/expected_records.txt" | ||
full_refresh: | ||
tests: | ||
- config_path: "secrets/config.json" | ||
- config_path: "secrets/config_cdc.json" | ||
# incremental: | ||
# tests: | ||
# - config_path: "secrets/config.json" | ||
# configured_catalog_path: "integration_tests/incremental_configured_catalog.json" | ||
# future_state: | ||
# bypass_reason: "A java.lang.NullPointerException is thrown when a state with an invalid cursor value is passed" | ||
# - config_path: "secrets/config_cdc.json" | ||
# configured_catalog_path: "integration_tests/incremental_configured_catalog.json" | ||
# future_state: | ||
# bypass_reason: "A java.lang.NullPointerException is thrown when a state with an invalid cursor value is passed" |
5 changes: 5 additions & 0 deletions
5
...egrations/connectors/source-postgres-strict-encrypt/integration_tests/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This directory contains files used to run Connector Acceptance Tests. | ||
* `abnormal_state.json` describes a connector state with a non-existing cursor value. | ||
* `expected_records.txt` lists all the records expected as the output of the basic read operation. | ||
* `incremental_configured_catalog.json` is a configured catalog used as an input of the `incremental` test. | ||
* `seed.sql` is the query we manually ran on a test postgres instance to seed it with test data and enable CDC. |
18 changes: 18 additions & 0 deletions
18
...egrations/connectors/source-postgres-strict-encrypt/integration_tests/abnormal_state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ | ||
"type": "STREAM", | ||
"stream": { | ||
"stream_state": { | ||
"stream_name": "id_and_name", | ||
"stream_namespace": "public", | ||
"cursor_field": ["id"], | ||
"cursor": "4", | ||
"cursor_record_count": 1 | ||
}, | ||
"stream_descriptor": { | ||
"name": "id_and_name", | ||
"namespace": "public" | ||
} | ||
} | ||
} | ||
] |
16 changes: 16 additions & 0 deletions
16
...te-integrations/connectors/source-postgres-strict-encrypt/integration_tests/acceptance.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
import pytest | ||
|
||
pytest_plugins = ("connector_acceptance_test.plugin",) | ||
|
||
|
||
@pytest.fixture(scope="session", autouse=True) | ||
def connector_setup(): | ||
"""This fixture is a placeholder for external resources that acceptance test might require.""" | ||
# TODO: setup test dependencies if needed. otherwise remove the TODO comments | ||
yield | ||
# TODO: clean up test dependencies |
3 changes: 3 additions & 0 deletions
3
...grations/connectors/source-postgres-strict-encrypt/integration_tests/expected_records.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{"stream": "id_and_name", "data": {"id": 1, "name": "picard"}, "emitted_at": 999999} | ||
{"stream": "id_and_name", "data": {"id": 2, "name": "crusher"}, "emitted_at": 999999} | ||
{"stream": "id_and_name", "data": {"id": 3, "name": "vash"}, "emitted_at": 999999} |
29 changes: 29 additions & 0 deletions
29
...tors/source-postgres-strict-encrypt/integration_tests/incremental_configured_catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"streams": [ | ||
{ | ||
"stream": { | ||
"name": "id_and_name", | ||
"json_schema": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"id": { | ||
"type": "number", | ||
"airbyte_type": "integer" | ||
} | ||
} | ||
}, | ||
"supported_sync_modes": ["full_refresh", "incremental"], | ||
"default_cursor_field": [], | ||
"source_defined_primary_key": [], | ||
"namespace": "public" | ||
}, | ||
"sync_mode": "incremental", | ||
"destination_sync_mode": "append", | ||
"cursor_field": ["id"], | ||
"user_defined_primary_key": ["id"] | ||
} | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
airbyte-integrations/connectors/source-postgres-strict-encrypt/integration_tests/seed.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
ALTER ROLE postgres WITH REPLICATION; | ||
|
||
CREATE | ||
TABLE | ||
id_and_name( | ||
id INTEGER, | ||
name VARCHAR(200) | ||
); | ||
|
||
INSERT | ||
INTO | ||
id_and_name( | ||
id, | ||
name | ||
) | ||
VALUES( | ||
1, | ||
'picard' | ||
), | ||
( | ||
2, | ||
'crusher' | ||
), | ||
( | ||
3, | ||
'vash' | ||
); | ||
|
||
SELECT | ||
pg_create_logical_replication_slot( | ||
'debezium_slot', | ||
'pgoutput' | ||
); | ||
|
||
CREATE | ||
PUBLICATION publication FOR ALL TABLES; |
Oops, something went wrong.