Skip to content

Commit

Permalink
Qa/fix build notification (#65)
Browse files Browse the repository at this point in the history
* fix slack notif for build

* remove click_performance_report from tests

* remove click_performance_report from sync canary test

* run only streams that are untested in canary sync

* just skip canaray test

* put back the assert in the skipped test

Co-authored-by: kspeer <[email protected]>
  • Loading branch information
kspeer825 and kspeer authored Jun 15, 2022
1 parent f55f47f commit a9ca558
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 27 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pip install 'setuptools==56.0.0'
pip install .[dev]
- slack/notify-on-failure:
only_for_branches: master
only_for_branches: main
- persist_to_workspace:
root: /usr/local/share/virtualenvs
paths:
Expand All @@ -45,7 +45,7 @@ jobs:
echo "$PYLINT_DISABLE_LIST"
pylint tap_google_ads --disable "$PYLINT_DISABLE_LIST"
- slack/notify-on-failure:
only_for_branches: master
only_for_branches: main

run_unit_tests:
executor: docker-executor
Expand All @@ -65,7 +65,7 @@ jobs:
- store_artifacts:
path: htmlcov
- slack/notify-on-failure:
only_for_branches: master
only_for_branches: main

run_integration_tests:
executor: docker-executor
Expand All @@ -89,7 +89,7 @@ jobs:
done
fi
- slack/notify-on-failure:
only_for_branches: master
only_for_branches: main

workflows:
version: 2
Expand Down
11 changes: 6 additions & 5 deletions tests/test_google_ads_automatic_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,19 @@ def test_happy_path(self):
streams_to_test = {stream for stream in self.expected_streams()
if stream not in {
# no test data available, but can generate
"keywords_performance_report", # needs a Search Campaign (currently have none)
'click_performance_report', # only last 90 days returned
'display_keyword_performance_report', # Singer Display #2, Ad Group 2
'display_topics_performance_report', # Singer Display #2, Ad Group 2
"keywords_performance_report", # needs a Search Campaign (currently have none)
# audiences are unclear on how metrics fall into segments
'campaign_audience_performance_report', # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
'ad_group_audience_performance_report', # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
'campaign_audience_performance_report', # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
# cannot generate test data
'placement_performance_report', # need an app to run javascript to trace conversions
"video_performance_report", # need a video to show
"shopping_performance_report", # need Shopping campaign type, and link to a store
"call_details", # need test call data before data will be returned
"shopping_performance_report", # need Shopping campaign type, and link to a store
"shopping_performance_report", # No automatic keys for this report
"video_performance_report", # need a video to show
'placement_performance_report', # need an app to run javascript to trace conversions
}}

# Run a discovery job
Expand Down
6 changes: 3 additions & 3 deletions tests/test_google_ads_bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ def test_run(self):

streams_under_test = self.expected_streams() - {
'ad_group_audience_performance_report',
'call_details', # need test call data before data will be returned
'campaign_audience_performance_report',
'click_performance_report', # only last 90 days returned
'display_keyword_performance_report',
'display_topics_performance_report',
'keywords_performance_report',
'placement_performance_report',
'search_query_performance_report',
'shopping_performance_report',
'video_performance_report',
'campaign_audience_performance_report',
'call_details', # need test call data before data will be returned
}

# Run a discovery job
Expand Down Expand Up @@ -93,7 +94,6 @@ def test_run(self):
'placeholder_feed_item_report': data_set_state_value_2,
'age_range_performance_report': data_set_state_value_1,
'account_performance_report': data_set_state_value_1,
'click_performance_report': data_set_state_value_1,
'campaign_performance_report': data_set_state_value_1,
'placeholder_report': data_set_state_value_2,
'ad_performance_report': data_set_state_value_1,
Expand Down
13 changes: 7 additions & 6 deletions tests/test_google_ads_start_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,16 @@ def run_test(self):
class StartDateTest1(StartDateTest):

missing_coverage_streams = { # no test data available
'ad_group_audience_performance_report',
'call_details',
'campaign_audience_performance_report',
'click_performance_report', # only last 90 days returned
'display_keyword_performance_report',
'display_topics_performance_report',
'keywords_performance_report',
'placement_performance_report',
"keywords_performance_report",
"video_performance_report",
'ad_group_audience_performance_report',
"shopping_performance_report",
'campaign_audience_performance_report',
'call_details',
'shopping_performance_report',
'video_performance_report',
}

def setUp(self):
Expand Down
21 changes: 12 additions & 9 deletions tests/test_google_ads_sync_canary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re
import unittest

from tap_tester import menagerie, connections, runner
from tap_tester.logger import LOGGER

from base import GoogleAdsBase

Expand All @@ -15,9 +17,11 @@ class SyncCanaryTest(GoogleAdsBase):
def name():
return "tt_google_ads_canary"

@unittest.skip("USED FOR MANUAL VERIFICATION OF TEST DATA ONLY")
def test_run(self):
"""
Testing that basic sync functions without Critical Errors
Testing that basic sync functions without Critical Errors for streams without test data
that are not covered in other tests.
Test Data available for the following report streams across the following dates (only the
first and last date that data was generated is listed).
Expand Down Expand Up @@ -70,24 +74,24 @@ def test_run(self):
"2021-12-06T00:00:00.000000Z"
"2022-03-14T00:00:00.000000Z"
"""
print("Canary Sync Test for tap-google-ads")
LOGGER.info("Canary Sync Test for tap-google-ads")

conn_id = connections.ensure_connection(self)

streams_to_test = self.expected_streams() - {
streams_to_test = - self.expected_streams() - {
# no test data available, but can generate
"call_details", # need test call data before data will be returned
"click_performance_report", # only last 90 days returned
"display_keyword_performance_report", # Singer Display #2, Ad Group 2
"display_topics_performance_report", # Singer Display #2, Ad Group 2
"keywords_performance_report", # needs a Search Campaign (currently have none)
# audiences are unclear on how metrics fall into segments
"campaign_audience_performance_report", # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
"ad_group_audience_performance_report", # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
"campaign_audience_performance_report", # Singer Display #2/Singer Display, Ad Group 2 (maybe?)
# cannot generate test data
"placement_performance_report", # need an app to run javascript to trace conversions
"video_performance_report", # need a video to show
"shopping_performance_report", # need Shopping campaign type, and link to a store

"video_performance_report", # need a video to show
}

# Run a discovery job
Expand Down Expand Up @@ -118,8 +122,7 @@ def test_run(self):

# Verify at least 1 record was replicated for each stream
for stream in streams_to_test:

with self.subTest(stream=stream):
record_count = len(synced_records.get(stream, {'messages': []})['messages'])
self.assertGreater(record_count, 0)
print(f"{record_count} {stream} record(s) replicated.")
record_count = len(synced_records.get(stream, {'messages': []})['messages'])
LOGGER.info(f"{record_count} {stream} record(s) replicated.")

0 comments on commit a9ca558

Please sign in to comment.