-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
source-postgres: enable SAT high test strictness level (#20549)
- Loading branch information
Showing
13 changed files
with
151 additions
and
10 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
airbyte-integrations/bases/source-acceptance-test/CHANGELOG.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
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
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
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
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
42 changes: 39 additions & 3 deletions
42
airbyte-integrations/connectors/source-postgres/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,7 +1,43 @@ | ||
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference) | ||
# for more information about how to configure these tests | ||
connector_image: airbyte/source-postgres:dev | ||
tests: | ||
test_strictness_level: high | ||
acceptance_tests: | ||
spec: | ||
- spec_path: "src/test-integration/resources/expected_spec.json" | ||
config_path: "src/test-integration/resources/dummy_config.json" | ||
tests: | ||
- spec_path: "src/test-integration/resources/expected_spec.json" | ||
config_path: "secrets/config.json" | ||
- spec_path: "src/test-integration/resources/expected_spec.json" | ||
config_path: "secrets/config_cdc.json" | ||
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" | ||
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" |
Empty file modified
0
airbyte-integrations/connectors/source-postgres/acceptance-test-docker.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions
5
airbyte-integrations/connectors/source-postgres/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 Source 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. |
13 changes: 13 additions & 0 deletions
13
airbyte-integrations/connectors/source-postgres/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,13 @@ | ||
[ | ||
{ | ||
"type": "STREAM", | ||
"stream": { | ||
"stream_state": { | ||
"id": 4 | ||
}, | ||
"stream_descriptor": { | ||
"name": "id_and_name" | ||
} | ||
} | ||
} | ||
] |
3 changes: 3 additions & 0 deletions
3
airbyte-integrations/connectors/source-postgres/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} |
32 changes: 32 additions & 0 deletions
32
...grations/connectors/source-postgres/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,32 @@ | ||
{ | ||
"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/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; |
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