diff --git a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml index e09b44607e01a..3996a4dec2d6e 100644 --- a/airbyte-config/init/src/main/resources/seed/source_definitions.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_definitions.yaml @@ -259,7 +259,7 @@ documentationUrl: https://docs.airbyte.com/integrations/sources/close-com icon: close.svg sourceType: api - releaseStage: alpha + releaseStage: beta - name: CoinGecko Coins sourceDefinitionId: 9cdd4183-d0ba-40c3-aad3-6f46d4103974 dockerRepository: airbyte/source-coingecko-coins @@ -267,7 +267,7 @@ documentationUrl: https://docs.airbyte.com/integrations/sources/coingecko-coins icon: coingeckocoins.svg sourceType: api - releaseStage: beta + releaseStage: alpha - name: Cockroachdb sourceDefinitionId: 9fa5862c-da7c-11eb-8d19-0242ac130003 dockerRepository: airbyte/source-cockroachdb diff --git a/airbyte-integrations/connectors/source-coingecko-coins/acceptance-test-config.yml b/airbyte-integrations/connectors/source-coingecko-coins/acceptance-test-config.yml index 02f8962dd2585..facea3353f000 100644 --- a/airbyte-integrations/connectors/source-coingecko-coins/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-coingecko-coins/acceptance-test-config.yml @@ -1,20 +1,28 @@ # 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-coingecko-coins:dev -tests: +acceptance_tests: spec: - - spec_path: "source_coingecko_coins/spec.yaml" + tests: + - spec_path: "source_coingecko_coins/spec.yaml" connection: - - config_path: "secrets/config.json" - status: "succeed" - - config_path: "integration_tests/invalid_config.json" - status: "failed" + tests: + - config_path: "secrets/config.json" + status: "succeed" + timeout_seconds: 120 + - config_path: "integration_tests/invalid_config.json" + status: "failed" discovery: - - config_path: "secrets/config.json" + tests: + - config_path: "secrets/config.json" basic_read: - - config_path: "secrets/config.json" - configured_catalog_path: "integration_tests/configured_catalog.json" - empty_streams: [] + tests: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" full_refresh: - - config_path: "secrets/config.json" - configured_catalog_path: "integration_tests/configured_catalog.json" + tests: + - config_path: "secrets/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" + # we ignore actively changing array with numbers to pass the `test two sequential reads` + ignored_fields: + market_chart: ["prices", "market_caps", "total_volumes"] diff --git a/airbyte-integrations/connectors/source-coingecko-coins/setup.py b/airbyte-integrations/connectors/source-coingecko-coins/setup.py index 56d30b19c39f0..1cadaac382a1d 100644 --- a/airbyte-integrations/connectors/source-coingecko-coins/setup.py +++ b/airbyte-integrations/connectors/source-coingecko-coins/setup.py @@ -6,7 +6,7 @@ from setuptools import find_packages, setup MAIN_REQUIREMENTS = [ - "airbyte-cdk~=0.1", + "airbyte-cdk~=0.2", ] TEST_REQUIREMENTS = [ diff --git a/airbyte-integrations/connectors/source-file/README.md b/airbyte-integrations/connectors/source-file/README.md index bd3ec225423fb..f256f29546572 100644 --- a/airbyte-integrations/connectors/source-file/README.md +++ b/airbyte-integrations/connectors/source-file/README.md @@ -132,6 +132,16 @@ docker run --rm -v $(pwd)/secrets:/secrets -v $(pwd)/sample_files:/sample_files 1. To run additional integration tests, place your integration tests in a new directory `integration_tests` and run them with `python -m pytest -s integration_tests`. Make sure to familiarize yourself with [pytest test discovery](https://docs.pytest.org/en/latest/goodpractices.html#test-discovery) to know how your test files and methods should be named. +#### Acceptance Tests +Customize `acceptance-test-config.yml` file to configure tests. See [Source Acceptance Tests](https://docs.airbyte.io/connector-development/testing-connectors/source-acceptance-tests-reference) for more information. +If your connector requires to create or destroy resources for use during acceptance tests create fixtures for it and place them inside integration_tests/acceptance.py. +To run your integration tests with acceptance tests, from the connector root, run +``` +docker build . --no-cache -t airbyte/source-file:dev \ +&& python -m pytest -p source_acceptance_test.plugin +``` +To run your integration tests with docker + ## Dependency Management All of your dependencies should go in `setup.py`, NOT `requirements.txt`. The requirements file is only used to connect internal Airbyte dependencies in the monorepo for local development. diff --git a/airbyte-integrations/connectors/source-file/acceptance-test-config.yml b/airbyte-integrations/connectors/source-file/acceptance-test-config.yml index ade248fea7911..6efdad6dbe3be 100644 --- a/airbyte-integrations/connectors/source-file/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-file/acceptance-test-config.yml @@ -1,19 +1,24 @@ # 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-file:dev -tests: +acceptance_tests: spec: - - spec_path: "source_file/spec.json" + tests: + - spec_path: "source_file/spec.json" connection: - - config_path: "integration_tests/config.json" - status: "succeed" - - config_path: "integration_tests/invalid_config.json" - status: "failed" + tests: + - config_path: "integration_tests/config.json" + status: "succeed" + - config_path: "integration_tests/invalid_config.json" + status: "failed" discovery: - - config_path: "integration_tests/config.json" + tests: + - config_path: "integration_tests/config.json" basic_read: - - config_path: "integration_tests/config.json" - configured_catalog_path: "integration_tests/configured_catalog.json" + tests: + - config_path: "integration_tests/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" full_refresh: - - config_path: "integration_tests/config.json" - configured_catalog_path: "integration_tests/configured_catalog.json" + tests: + - config_path: "integration_tests/config.json" + configured_catalog_path: "integration_tests/configured_catalog.json" diff --git a/airbyte-integrations/connectors/source-file/unit_tests/test_source.py b/airbyte-integrations/connectors/source-file/unit_tests/test_source.py index 17ee5493c06a9..bd3ef4567f059 100644 --- a/airbyte-integrations/connectors/source-file/unit_tests/test_source.py +++ b/airbyte-integrations/connectors/source-file/unit_tests/test_source.py @@ -149,12 +149,11 @@ def test_discover(source, config, client): def test_check_wrong_reader_options(source, config): config["reader_options"] = '{encoding":"utf_16"}' - with pytest.raises(Exception): - source.check(logger=logger, config=config) assert source.check(logger=logger, config=config) == AirbyteConnectionStatus( status=Status.FAILED, message="reader_options is not valid JSON" ) + def test_check_google_spreadsheets_url(source, config): config["url"] = "https://docs.google.com/spreadsheets/d/" assert source.check(logger=logger, config=config) == AirbyteConnectionStatus(