Skip to content

Commit

Permalink
Changes:
Browse files Browse the repository at this point in the history
1. Added an earlier start date to include more testable streams.
2. Added message to remove code to X-fail parent child integration test once data is available for testing.
  • Loading branch information
shantanu73 committed Apr 25, 2024
1 parent dc60686 commit 309d3ee
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
16 changes: 14 additions & 2 deletions tests/test_all_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class IntercomAllFields(IntercomBaseTest):
'size',
'website',
'industry',
'segments'
'segments',
'tags'
},
'conversations': {
'user',
Expand All @@ -35,8 +36,19 @@ class IntercomAllFields(IntercomBaseTest):
'contact_attributes': {
'options',
'admin_id'
},
'contacts': {
'tags'
}
}

def get_properties(self):
"""Configuration properties required for the tap."""
return_value = {
'start_date' : "2016-01-01T00:00:00Z"
}
return return_value

@staticmethod
def name():
return "tap_tester_intercom_all_fields"
Expand All @@ -48,7 +60,7 @@ def test_run(self):
• verify all fields for each stream are replicated
"""
# Streams for which we cannot generate data
untestable_streams = {"segments", "tags", "contacts", "company_segments", "conversation_parts", "companies", "conversations"}
untestable_streams = {"tags", "segments" ,"conversation_parts", "conversations", "company_segments"}
expected_streams = self.expected_streams().difference(untestable_streams)

# instantiate connection
Expand Down
9 changes: 8 additions & 1 deletion tests/test_intercom_automatic_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class IntercomAutomaticFields(IntercomBaseTest):
def name():
return "tap_tester_intercom_automatic_fields"

def get_properties(self):
"""Configuration properties required for the tap."""
return_value = {
'start_date' : "2016-01-01T00:00:00Z"
}
return return_value

def test_run(self):
"""
Verify that for each stream you can get multiple pages of data
Expand All @@ -24,7 +31,7 @@ def test_run(self):
that 251 (or more) records have been posted for that stream.
"""
# Streams for which we cannot generate data
untestable_streams = {"segments", "tags", "contacts", "company_segments", "conversation_parts", "companies", "conversations"}
untestable_streams = {"conversation_parts", "conversations", "segments", "tags", "company_segments"}
expected_streams = self.expected_streams().difference(untestable_streams)

# Instantiate connection
Expand Down
6 changes: 3 additions & 3 deletions tests/test_intercom_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def name():
def get_properties(self):
"""Configuration properties required for the tap."""
return_value = {
'start_date' : "2016-02-05T00:00:00Z"
'start_date' : "2016-01-01T00:00:00Z"
}
return return_value

Expand All @@ -29,15 +29,15 @@ def test_run(self):
fetch of data. For instance if you have a limit of 100 records ensure
that 101 (or more) records have been posted for that stream.
"""
page_size = 100
page_size = 50
conn_id = connections.ensure_connection(self)

# Checking pagination for streams having enough data
expected_streams = [
# "conversations",
# The Contacts stream API has a delay in updating the records. Thus, we are getting some duplicate records.
# Reference Ticket: https://jira.talendforge.org/browse/TDL-19860
# "contacts",
"contacts",
# "tags",
"companies"
]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_intercom_parent_child_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ def name():

@unittest.expectedFailure
def test_run(self):
# Once suficiennt data is generated for the test, remove below line
self.assertFalse(True, "X-Failing this test due to insufficient test data.")

# Run with parent stream as earlier bookmark
self.run_test(
child_bookmark=(dt.now()).strftime(self.START_DATE_FORMAT),
Expand Down

0 comments on commit 309d3ee

Please sign in to comment.