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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ tap-salesforce --config config.json --properties properties.json --state state

# Quickstart

## Install the tap
## Install the taps

```
> pip install tap-salesforce
Expand Down
5 changes: 3 additions & 2 deletions tests/test_salesforce_all_fields_non_custom_rest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Test that with only non-custom fields selected for a stream automatic fields and non custom fields are still replicated
"""
from tap_tester import menagerie, runner
from tap_tester import menagerie, runner, LOGGER
from tap_tester.base_suite_tests.all_fields_test import AllFieldsTest
from sfbase import SFBaseTest

Expand Down Expand Up @@ -58,11 +58,12 @@ def streams_to_selected_fields(self):
return non_custom_fields

def test_non_custom_fields(self):
found_catalogs = AllFieldsTest.found_catalogs
excluded_fields = {'MlFeatureValueMetric'}
for stream in self.streams_to_test():
with self.subTest(stream=stream):
found_catalog_names = {catalog['tap_stream_id'] for catalog in found_catalogs}
self.assertTrue(streams_to_test.issubset(found_catalog_names))
self.assertTrue(self.streams_to_test().issubset(found_catalog_names))
LOGGER.info("discovered schemas are OK")
expected_non_custom_fields = self.selected_fields.get(stream,set()) - excluded_fields
replicated_non_custom_fields = self.actual_fields.get(stream, set())
Expand Down
10 changes: 6 additions & 4 deletions tests/test_salesforce_switch_rep_method_ft_incrmntl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ def test_run(self):

# Select only the expected streams tables
expected_streams = self.expected_sync_streams()
catalog_entries = [ce for ce in found_catalogs if ce['tap_stream_id'] in expected_streams]
filtered_streams = [stream for stream in expected_streams if replication_keys.get(stream) and len(replication_keys.get(stream)) > 0]
catalog_entries = [ce for ce in found_catalogs if ce['tap_stream_id'] in filtered_streams]
self.select_all_streams_and_fields(conn_id, catalog_entries)
streams_replication_methods = {stream: self.FULL_TABLE
for stream in expected_streams}
for stream in filtered_streams}
self.set_replication_methods(conn_id, catalog_entries, streams_replication_methods)

# Run a sync job using orchestrator
Expand All @@ -41,7 +42,7 @@ def test_run(self):

#Switch the replication method from full table to Incremental
streams_replication_methods = {stream: self.INCREMENTAL
for stream in expected_streams}
for stream in filtered_streams}
self.set_replication_methods(conn_id, catalog_entries, streams_replication_methods)

# SYNC 2
Expand All @@ -50,7 +51,8 @@ def test_run(self):
incrmntl_sync_bookmarks = menagerie.get_state(conn_id)

# Test by stream
for stream in expected_streams:
filtered_streams = [s for s in filtered_streams if incrmntl_sync_record_count.get(s,0) > 0 or fulltbl_sync_record_count.get(s,0) > 0]
for stream in filtered_streams:
with self.subTest(stream=stream):
# record counts
fulltbl_sync_count = fulltbl_sync_record_count.get(stream, 0)
Expand Down
10 changes: 6 additions & 4 deletions tests/test_salesforce_switch_rep_method_incrmntl_ft.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ def test_run(self):

# Select only the expected streams tables
expected_streams = self.expected_sync_streams()
catalog_entries = [ce for ce in found_catalogs if ce['tap_stream_id'] in expected_streams]
filtered_streams = [stream for stream in expected_streams if replication_keys.get(stream) and len(replication_keys.get(stream)) > 0]
catalog_entries = [ce for ce in found_catalogs if ce['tap_stream_id'] in filtered_streams]
self.select_all_streams_and_fields(conn_id, catalog_entries)
streams_replication_methods = {stream: self.INCREMENTAL
for stream in expected_streams}
for stream in filtered_streams}
self.set_replication_methods(conn_id, catalog_entries, streams_replication_methods)

# Run a sync job using orchestrator
Expand All @@ -40,7 +41,7 @@ def test_run(self):

#Switch the replication method from incremental to full table
streams_replication_methods = {stream: self.FULL_TABLE
for stream in expected_streams}
for stream in filtered_streams}
self.set_replication_methods(conn_id, catalog_entries, streams_replication_methods)

# SYNC 2
Expand All @@ -49,7 +50,8 @@ def test_run(self):
fulltbl_sync_bookmarks = menagerie.get_state(conn_id)

# Test by stream
for stream in expected_streams:
filtered_streams = [s for s in filtered_streams if incrmntl_sync_record_count.get(s,0) > 0 or fulltbl_sync_record_count.get(s,0) > 0]
for stream in filtered_streams:
with self.subTest(stream=stream):
# record counts
incrmntl_sync_count = incrmntl_sync_record_count.get(stream, 0)
Expand Down