forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend template for the Java JDBC template by SAT SPEC (airbytehq#19660)
* extend template for the Java JDBC template by SAT SPEC * extend example source scaffold-java-jdbc * review upd * add other SAT tests to the template * review upd * comment non-spec tests * Revert "comment non-spec tests" This reverts commit 8c78049. * Revert "add other SAT tests to the template" This reverts commit c15b4dc. * review * review * typo * typo * new line
- Loading branch information
1 parent
bedc3b9
commit 39c8801
Showing
12 changed files
with
214 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
airbyte-integrations/connector-templates/source-java-jdbc/acceptance-test-config.yml.hbs
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,7 @@ | ||
# 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-{{dashCase name}}:dev | ||
tests: | ||
spec: | ||
- spec_path: "src/test-integration/resources/expected_spec.json" | ||
config_path: "src/test-integration/resources/dummy_config.json" |
15 changes: 15 additions & 0 deletions
15
airbyte-integrations/connector-templates/source-java-jdbc/acceptance-test-docker.sh
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,15 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Build latest connector image | ||
docker build . -t $(cat acceptance-test-config.yml | grep "connector_image" | head -n 1 | cut -d: -f2-) | ||
|
||
# Pull latest acctest image | ||
docker pull airbyte/source-acceptance-test:latest | ||
|
||
# Run | ||
docker run --rm -it \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v /tmp:/tmp \ | ||
-v $(pwd):/test_input \ | ||
airbyte/source-acceptance-test \ | ||
--acceptance-test-config /test_input |
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
16 changes: 16 additions & 0 deletions
16
airbyte-integrations/connector-templates/source-java-jdbc/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) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
import pytest | ||
|
||
pytest_plugins = ("source_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 |
7 changes: 7 additions & 0 deletions
7
...ons/connector-templates/source-java-jdbc/src/test-integration/resources/dummy_config.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,7 @@ | ||
{ | ||
"host": "default", | ||
"port": 5555, | ||
"database": "default", | ||
"username": "default", | ||
"replication_method": "STANDARD" | ||
} |
61 changes: 61 additions & 0 deletions
61
...onnector-templates/source-java-jdbc/src/test-integration/resources/expected_spec.json.hbs
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,61 @@ | ||
{ | ||
"documentationUrl": "https://docs.airbyte.com/integrations/sources/{{snakeCase name}}", | ||
"connectionSpecification": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "{{pascalCase name}} Source Spec", | ||
"type": "object", | ||
"required": ["host", "port", "database", "username", "replication_method"], | ||
"properties": { | ||
"host": { | ||
"title": "Host", | ||
"description": "Hostname of the database.", | ||
"type": "string", | ||
"order": 0 | ||
}, | ||
"port": { | ||
"title": "Port", | ||
"description": "Port of the database.", | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 65536, | ||
"default": 3306, | ||
"examples": ["3306"], | ||
"order": 1 | ||
}, | ||
"database": { | ||
"title": "Database", | ||
"description": "Name of the database.", | ||
"type": "string", | ||
"order": 2 | ||
}, | ||
"username": { | ||
"title": "Username", | ||
"description": "Username to use to access the database.", | ||
"type": "string", | ||
"order": 3 | ||
}, | ||
"password": { | ||
"title": "Password", | ||
"description": "Password associated with the username.", | ||
"type": "string", | ||
"airbyte_secret": true, | ||
"order": 4 | ||
}, | ||
"jdbc_url_params": { | ||
"title": "JDBC URL params", | ||
"description": "Additional properties to pass to the JDBC URL string when connecting to the database formatted as 'key=value' pairs separated by the symbol '&'. (example: key1=value1&key2=value2&key3=value3)", | ||
"type": "string", | ||
"order": 5 | ||
}, | ||
"replication_method": { | ||
"title": "Replication method", | ||
"description": "Replication method to use for extracting data from the database. STANDARD replication requires no setup on the DB side but will not be able to represent deletions incrementally. CDC uses the Binlog to detect inserts, updates, and deletes. This needs to be configured on the source database itself.", | ||
"type": "string", | ||
"order": 6, | ||
"default": "STANDARD", | ||
"enum": ["STANDARD", "CDC"] | ||
} | ||
} | ||
}, | ||
"supported_destination_sync_modes": [] | ||
} |
7 changes: 7 additions & 0 deletions
7
airbyte-integrations/connectors/source-scaffold-java-jdbc/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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 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-scaffold-java-jdbc:dev | ||
tests: | ||
spec: | ||
- spec_path: "src/test-integration/resources/expected_spec.json" | ||
config_path: "src/test-integration/resources/dummy_config.json" |
15 changes: 15 additions & 0 deletions
15
airbyte-integrations/connectors/source-scaffold-java-jdbc/acceptance-test-docker.sh
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,15 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Build latest connector image | ||
docker build . -t $(cat acceptance-test-config.yml | grep "connector_image" | head -n 1 | cut -d: -f2-) | ||
|
||
# Pull latest acctest image | ||
docker pull airbyte/source-acceptance-test:latest | ||
|
||
# Run | ||
docker run --rm -it \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
-v /tmp:/tmp \ | ||
-v $(pwd):/test_input \ | ||
airbyte/source-acceptance-test \ | ||
--acceptance-test-config /test_input |
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
16 changes: 16 additions & 0 deletions
16
airbyte-integrations/connectors/source-scaffold-java-jdbc/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) 2022 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
import pytest | ||
|
||
pytest_plugins = ("source_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 |
7 changes: 7 additions & 0 deletions
7
...ons/connectors/source-scaffold-java-jdbc/src/test-integration/resources/dummy_config.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,7 @@ | ||
{ | ||
"host": "default", | ||
"port": 5555, | ||
"database": "default", | ||
"username": "default", | ||
"replication_method": "STANDARD" | ||
} |
61 changes: 61 additions & 0 deletions
61
...ns/connectors/source-scaffold-java-jdbc/src/test-integration/resources/expected_spec.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,61 @@ | ||
{ | ||
"documentationUrl": "https://docs.airbyte.com/integrations/sources/scaffold_java_jdbc", | ||
"connectionSpecification": { | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ScaffoldJavaJdbc Source Spec", | ||
"type": "object", | ||
"required": ["host", "port", "database", "username", "replication_method"], | ||
"properties": { | ||
"host": { | ||
"title": "Host", | ||
"description": "Hostname of the database.", | ||
"type": "string", | ||
"order": 0 | ||
}, | ||
"port": { | ||
"title": "Port", | ||
"description": "Port of the database.", | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 65536, | ||
"default": 3306, | ||
"examples": ["3306"], | ||
"order": 1 | ||
}, | ||
"database": { | ||
"title": "Database", | ||
"description": "Name of the database.", | ||
"type": "string", | ||
"order": 2 | ||
}, | ||
"username": { | ||
"title": "Username", | ||
"description": "Username to use to access the database.", | ||
"type": "string", | ||
"order": 3 | ||
}, | ||
"password": { | ||
"title": "Password", | ||
"description": "Password associated with the username.", | ||
"type": "string", | ||
"airbyte_secret": true, | ||
"order": 4 | ||
}, | ||
"jdbc_url_params": { | ||
"title": "JDBC URL params", | ||
"description": "Additional properties to pass to the JDBC URL string when connecting to the database formatted as 'key=value' pairs separated by the symbol '&'. (example: key1=value1&key2=value2&key3=value3)", | ||
"type": "string", | ||
"order": 5 | ||
}, | ||
"replication_method": { | ||
"title": "Replication method", | ||
"description": "Replication method to use for extracting data from the database. STANDARD replication requires no setup on the DB side but will not be able to represent deletions incrementally. CDC uses the Binlog to detect inserts, updates, and deletes. This needs to be configured on the source database itself.", | ||
"type": "string", | ||
"order": 6, | ||
"default": "STANDARD", | ||
"enum": ["STANDARD", "CDC"] | ||
} | ||
} | ||
}, | ||
"supported_destination_sync_modes": [] | ||
} |