Skip to content

Commit

Permalink
Fix sync canary test
Browse files Browse the repository at this point in the history
  • Loading branch information
prijendev committed Oct 31, 2024
1 parent be341a9 commit 18c22d2
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 2 deletions.
94 changes: 94 additions & 0 deletions tests/sfbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -1204,16 +1204,110 @@ def count_custom_non_custom_fields(fields):
def get_streams_with_data():
#the streams listed here are the streams that have data currently
streams_with_data = {
'ActiveFeatureLicenseMetric',
'AppMenuItem',
'AuthSession',
'Account',
'Calendar',
'AppointmentSchedulingPolicy',
'Campaign',
'AssignmentRule',
'ActivePermSetLicenseMetric',
'AppDefinition',
'BusinessHours',
'ActiveProfileMetric',
'Calendar',
'ContentWorkspacePermission',
'CampaignMemberStatus',
'Community',
'Contact',
'Case',
'ClientBrowser',
'BusinessHours',
'ContentWorkspace',
'Campaign',
'FieldPermissions',
'Group',
'EventLogFile',
'FiscalYearSettings',
'ListView',
'LoginHistory',
'LeadStatus',
'Lead',
'FormulaFunctionAllowedType',
'LoginIp',
'FileSearchActivity',
'FormulaFunctionCategory',
'Folder',
'FormulaFunction',
'MatchingRule',

# removing form the list has not getting any data
# 'LightningUsageByFlexiPageMetrics',
# 'LightningUsageByAppTypeMetrics',
# 'LightningUsageByBrowserMetrics',
# 'LightningUsageByPageMetrics',
# 'LightningToggleMetrics',
# 'LightningExitByPageMetrics',

'LoginGeo',
'FlowDefinitionView',
'PermissionSetTabSetting',
'MilestoneType',
'Period',
'MatchingRule',
'OpportunityStage',
'PlatformEventUsageMetric',
'Organization',
'OpportunityHistory',
'Pricebook2',
'PermissionSetLicense',
'ObjectPermissions',
'Opportunity',
'PermissionSetAssignment',
'OauthToken',
'PricebookEntry',
'Profile',
'PermissionSet',
'Product2',
'PromptAction',
'SetupEntityAccess',
'Profile',
'Publisher',
'ServiceSetupProvisioning',
'Report',
'Solution',
'PromptActionShare',
'SlaProcess',
'SetupAuditTrail',
'UiFormulaRule',
'WebLink',
'UserPermissionAccess',
'UserRole',
'TabDefinition',
'UserLogin',
'UserAppMenuItem',
'TenantUsageEntitlement',
'UserLicense',
'User',
'TapTester__c',
'SlaProcess',
'UserAppInfo',
'UiFormulaCriterion',
'Solution',
'FieldPermissions',
'EntityDefinition',
'ContentWorkspace',
'DuplicateRule',
'CronTrigger',
'Domain',
'ContentWorkspacePermission',
'EmailTemplate',
'EventLogFile',
'CronJobDetail',
'Entitlement',
'FlowRecordVersion',
'FlowRecord'
}
return streams_with_data

Expand Down
4 changes: 2 additions & 2 deletions tests/test_salesforce_sync_canary.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def name():
@staticmethod
def get_properties(): # pylint: disable=arguments-differ
return {
'start_date' : (datetime.now() + timedelta(days=-1)).strftime("%Y-%m-%dT00:00:00Z"),
'start_date' : '2024-03-12T00:00:00Z',
'instance_url': 'https://singer2-dev-ed.my.salesforce.com',
'select_fields_by_default': 'true',
'api_type': 'BULK',
Expand Down Expand Up @@ -56,4 +56,4 @@ def test_run(self):
actual_streams_with_data ={stream for stream in record_count_by_stream
if record_count_by_stream[stream] > 0}
self.assertTrue(actual_streams_with_data.issubset(self.get_streams_with_data()),
msg = f"New streams with data are synced {self.get_streams_with_data().difference(actual_streams_with_data)}")
msg = f"New streams with data are synced {actual_streams_with_data.difference(self.get_streams_with_data())}")

0 comments on commit 18c22d2

Please sign in to comment.