From 4017c0a9283d2e446e494245e66c1333395db63e Mon Sep 17 00:00:00 2001 From: Augustin Date: Wed, 14 Dec 2022 10:12:57 +0100 Subject: [PATCH] SAT: skip backward compatibility tests on spec/catalog if previous and actual spec/catalog are identical (#20435) --- .../bases/source-acceptance-test/CHANGELOG.md | 3 +++ .../bases/source-acceptance-test/Dockerfile | 2 +- .../source_acceptance_test/tests/test_core.py | 20 +++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/airbyte-integrations/bases/source-acceptance-test/CHANGELOG.md b/airbyte-integrations/bases/source-acceptance-test/CHANGELOG.md index c678e58b9e87c..193b110449f9d 100644 --- a/airbyte-integrations/bases/source-acceptance-test/CHANGELOG.md +++ b/airbyte-integrations/bases/source-acceptance-test/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.2.23 +Skip backward compatibility tests on specifications if actual and previous specifications and discovered catalogs are identical.[#20435](https://github.com/airbytehq/airbyte/pull/20435) + ## 0.2.22 Capture control messages to store and use updated configurations. [#19979](https://github.com/airbytehq/airbyte/pull/19979). diff --git a/airbyte-integrations/bases/source-acceptance-test/Dockerfile b/airbyte-integrations/bases/source-acceptance-test/Dockerfile index e7a3eff1bcd45..24cc460a6f2e2 100644 --- a/airbyte-integrations/bases/source-acceptance-test/Dockerfile +++ b/airbyte-integrations/bases/source-acceptance-test/Dockerfile @@ -33,7 +33,7 @@ COPY pytest.ini setup.py ./ COPY source_acceptance_test ./source_acceptance_test RUN pip install . -LABEL io.airbyte.version=0.2.22 +LABEL io.airbyte.version=0.2.23 LABEL io.airbyte.name=airbyte/source-acceptance-test ENTRYPOINT ["python", "-m", "pytest", "-p", "source_acceptance_test.plugin", "-r", "fEsx"] diff --git a/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py b/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py index b1fd78d9e30eb..0928b07b3db80 100644 --- a/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py +++ b/airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_core.py @@ -83,7 +83,16 @@ class TestSpec(BaseTest): previous_spec_cache: ConnectorSpecification = None @pytest.fixture(name="skip_backward_compatibility_tests") - def skip_backward_compatibility_tests_fixture(self, inputs: SpecTestConfig, previous_connector_docker_runner: ConnectorRunner) -> bool: + def skip_backward_compatibility_tests_fixture( + self, + inputs: SpecTestConfig, + previous_connector_docker_runner: ConnectorRunner, + previous_connector_spec: ConnectorSpecification, + actual_connector_spec: ConnectorSpecification, + ) -> bool: + if actual_connector_spec == previous_connector_spec: + pytest.skip("The previous and actual specifications are identical.") + if previous_connector_docker_runner is None: pytest.skip("The previous connector image could not be retrieved.") @@ -358,8 +367,15 @@ def test_check(self, connector_config, inputs: ConnectionTestConfig, docker_runn class TestDiscovery(BaseTest): @pytest.fixture(name="skip_backward_compatibility_tests") def skip_backward_compatibility_tests_fixture( - self, inputs: DiscoveryTestConfig, previous_connector_docker_runner: ConnectorRunner + self, + inputs: DiscoveryTestConfig, + previous_connector_docker_runner: ConnectorRunner, + discovered_catalog: MutableMapping[str, AirbyteStream], + previous_discovered_catalog: MutableMapping[str, AirbyteStream], ) -> bool: + if discovered_catalog == previous_discovered_catalog: + pytest.skip("The previous and actual discovered catalogs are identical.") + if previous_connector_docker_runner is None: pytest.skip("The previous connector image could not be retrieved.")