Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,20 @@ def expected_metadata(self):
self.PRIMARY_KEYS: {"ID"},
self.REPLICATION_METHOD: self.INCREMENTAL,
self.REPLICATION_KEYS: {"ModifiedDate"},
}
}
}

def streams_to_select(self):
def streams_to_select(self, is_discovery=False):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining this logic in base in an anti-pattern. We should not abstract away the streams under test. It should be defined at the test level.

# events: there are 5 events and the API call window is of 10 minutes
# so there will be a lot of API calls for every test
# list_subscriber: as the API window is of 1 day, the tests took
# 30 minutes to run 3 tests, the test run time will be increased
# when all the tests are combined
# subscriber: it is the child stream of 'list_subscriber'
return set(self.expected_metadata().keys()) - {'event', 'list_subscriber', 'subscriber'}
if is_discovery:
return set(self.expected_metadata().keys())

return set(self.expected_metadata().keys()) - {'event', 'list_subscriber', 'subscriber', 'data_extension.my_test'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you investigate why this stream is now failing? Is this a problem with test data, or a problem with the tap? When we lose coverage on a stream we need to root cause the issue. If the root cause cannot be easily determined then a backlog ticket should be created to investigate the issue.


def expected_replication_keys(self):
return {table: properties.get(self.REPLICATION_KEYS, set())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_exacttarget_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_run(self):
conn_id = connections.ensure_connection(self)
runner.run_check_mode(self, conn_id)

streams_to_test = self.streams_to_select()
streams_to_test = self.streams_to_select(is_discovery=True)
found_catalogs = menagerie.get_catalogs(conn_id)

# verify the stream names discovered were what we expect
Expand Down