This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for invalid and valid records from postgres-tap (#55)
* Add optional validate_records option * fixed pylint * Introduce InvalidTableStructureException * Tests for invalid and valid records from postgres-tap * trigger build * do not raise InvalidTableStructureException in flush_records * fixed test * trigger build * removed extra tab Co-authored-by: Peter Kosztolanyi <[email protected]>
- Loading branch information
1 parent
5f6ba6a
commit 8d31e29
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
tests/integration/resources/messages-pg-with-invalid-records.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,4 @@ | ||
{"type": "SCHEMA", "stream": "pg-invalid-records", "schema": {"definitions": {"sdc_recursive_boolean_array": {"items": {"$ref": "#/definitions/sdc_recursive_boolean_array"}, "type": ["null", "boolean", "array"]}, "sdc_recursive_integer_array": {"items": {"$ref": "#/definitions/sdc_recursive_integer_array"}, "type": ["null", "integer", "array"]}, "sdc_recursive_number_array": {"items": {"$ref": "#/definitions/sdc_recursive_number_array"}, "type": ["null", "number", "array"]}, "sdc_recursive_object_array": {"items": {"$ref": "#/definitions/sdc_recursive_object_array"}, "type": ["null", "object", "array"]}, "sdc_recursive_string_array": {"items": {"$ref": "#/definitions/sdc_recursive_string_array"}, "type": ["null", "string", "array"]}, "sdc_recursive_timestamp_array": {"format": "date-time", "items": {"$ref": "#/definitions/sdc_recursive_timestamp_array"}, "type": ["null", "string", "array"]}}, "properties": {"id": {"maximum": 9223372036854775807, "minimum": -9223372036854775808, "type": ["integer"]}, "results": {"type": ["null", "object"]}, "time_created": {"format": "date-time", "type": ["null", "string"]}}, "type": "object"}, "key_properties": ["id"], "bookmark_properties": ["id"]} | ||
{"type": "STATE", "value": {"bookmarks": {"pg-invalid-records": {"replication_key": "id", "replication_key_value": 52799009, "version": 1, "last_replication_method": "INCREMENTAL"}}, "currently_syncing": "pg-invalid-records"}} | ||
{"type": "ACTIVATE_VERSION", "stream": "pg-invalid-records", "version": 1} | ||
{"type": "RECORD", "stream": "pg-invalid-records", "record": {"id": 52799009, "results": "[{\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}, {\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}, {\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}, {\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}, {\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}, {\"rule\": \"XYZ\", \"reason\": \"XYZ\", \"actions\": []}]", "time_created": "2019-12-17T11:40:15.296955+00:00"}, "version": 1, "time_extracted": "2019-12-17T12:04:46.015519Z"} |
4 changes: 4 additions & 0 deletions
4
tests/integration/resources/messages-pg-with-valid-records.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,4 @@ | ||
{"type": "SCHEMA", "stream": "pg-valid-records", "schema": {"definitions": {"sdc_recursive_boolean_array": {"items": {"$ref": "#/definitions/sdc_recursive_boolean_array"}, "type": ["null", "boolean", "array"]}, "sdc_recursive_integer_array": {"items": {"$ref": "#/definitions/sdc_recursive_integer_array"}, "type": ["null", "integer", "array"]}, "sdc_recursive_number_array": {"items": {"$ref": "#/definitions/sdc_recursive_number_array"}, "type": ["null", "number", "array"]}, "sdc_recursive_object_array": {"items": {"$ref": "#/definitions/sdc_recursive_object_array"}, "type": ["null", "object", "array"]}, "sdc_recursive_string_array": {"items": {"$ref": "#/definitions/sdc_recursive_string_array"}, "type": ["null", "string", "array"]}, "sdc_recursive_timestamp_array": {"format": "date-time", "items": {"$ref": "#/definitions/sdc_recursive_timestamp_array"}, "type": ["null", "string", "array"]}}, "properties": {"id": {"maximum": 9223372036854775807, "minimum": -9223372036854775808, "type": ["integer"]}, "results": {"type": ["null", "array", "object"]}, "time_created": {"format": "date-time", "type": ["null", "string"]}}, "type": "object"}, "key_properties": ["id"], "bookmark_properties": ["id"]} | ||
{"type": "STATE", "value": {"bookmarks": {"pg-valid-records": {"replication_key": "id", "replication_key_value": 52799009, "version": 1, "last_replication_method": "INCREMENTAL"}}, "currently_syncing": "pg-valid-records"}} | ||
{"type": "ACTIVATE_VERSION", "stream": "pg-valid-records", "version": 1} | ||
{"type": "RECORD", "stream": "pg-valid-records", "record": {"id": 52799009, "results": [{"rule": "XYZ", "reason": "XYZ", "actions": []}, {"rule": "XYZ", "reason": "XYZ", "actions": []}, {"rule": "XYZ", "reason": "XYZ", "actions": []}, {"rule": "XYZ", "reason": "XYZ", "actions": []}, {"rule": "XYZ", "reason": "XYZ", "actions": []}], "time_created": "2019-12-17T11:40:15.296955+00:00"}, "version": 1, "time_extracted": "2019-12-17T19:12:12.006049Z"} |
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