From e3aaf5e214af9df5607706e6f289edb46ad7f4c7 Mon Sep 17 00:00:00 2001 From: oleh Date: Mon, 26 Jul 2021 12:45:43 +0300 Subject: [PATCH] 4827 Facebook Marketing test fixes Update values in `abnormal_state.json` because they contained outdated values. Add base class for `TestFacebookMarketingSource`. Use `empty_streams` instead of `validate_output_from_all_streams`. --- .../acceptance-test-config.yml | 6 +++++- .../integration_tests/abnormal_state.json | 20 +++++++++---------- .../integration_tests/test_streams.py | 3 ++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/airbyte-integrations/connectors/source-facebook-marketing/acceptance-test-config.yml b/airbyte-integrations/connectors/source-facebook-marketing/acceptance-test-config.yml index 357bb2cc4f219..5c2e573704dbd 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/acceptance-test-config.yml +++ b/airbyte-integrations/connectors/source-facebook-marketing/acceptance-test-config.yml @@ -14,7 +14,11 @@ tests: basic_read: - config_path: "secrets/config.json" configured_catalog_path: "integration_tests/configured_catalog.json" - validate_output_from_all_streams: yes + empty_streams: + - ads_insights + - ads_insights_age_and_gender + - ad_sets + - ads # FB serializes numeric fields as strings validate_schema: no incremental: diff --git a/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/abnormal_state.json b/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/abnormal_state.json index 437161ace3dce..f516de3682e07 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/abnormal_state.json +++ b/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/abnormal_state.json @@ -1,42 +1,42 @@ { "campaigns": { - "updated_time": "2021-07-25T13:34:26Z", + "updated_time": "2121-07-25T13:34:26Z", "include_deleted": true }, "ad_creatives": { - "updated_time": "2021-07-25T13:34:26Z", + "updated_time": "2121-07-25T13:34:26Z", "include_deleted": true }, "ad_sets": { - "updated_time": "2021-07-25T13:34:26Z", + "updated_time": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads": { - "updated_time": "2021-07-25T13:34:26Z", + "updated_time": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights_age_and_gender": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights_country": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights_dma": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights_platfrom_and_device": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true }, "ads_insights_region": { - "date_start": "2021-07-25T13:34:26Z", + "date_start": "2121-07-25T13:34:26Z", "include_deleted": true } } diff --git a/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py b/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py index 04758bd6fa00a..78bdc3ccef25f 100644 --- a/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py +++ b/airbyte-integrations/connectors/source-facebook-marketing/integration_tests/test_streams.py @@ -27,6 +27,7 @@ from typing import Any, List, MutableMapping, Set, Tuple import pytest +from source_acceptance_test.base import BaseTest from airbyte_cdk import AirbyteLogger from airbyte_cdk.models import AirbyteMessage, ConfiguredAirbyteCatalog, Type from source_facebook_marketing.source import SourceFacebookMarketing @@ -55,7 +56,7 @@ def configured_catalog_fixture(): return ConfiguredAirbyteCatalog.parse_file("integration_tests/configured_catalog.json") -class TestFacebookMarketingSource: +class TestFacebookMarketingSource(BaseTest): @pytest.mark.parametrize( "stream_name, deleted_id", [("ads", "23846756820320398"), ("campaigns", "23846541919710398"), ("ad_sets", "23846541706990398")] )