Skip to content

Commit

Permalink
updated tap-tester image in config file to use stitch-tap-tester (sin…
Browse files Browse the repository at this point in the history
…ger-io#65)

* updated tap-tester image in config file to use stitch-tap-tester

* Remove scenarios

* installed pymongo

* changed install

* added pymongo install

* fixed typo

Co-authored-by: Collin Simon <[email protected]>
  • Loading branch information
jacobrobertbaca and cosimon authored Sep 27, 2021
1 parent 45527d4 commit 49878ec
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 44 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ orbs:
jobs:
build:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:tap-tester-v4
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester
- image: mongo:4.2.0-bionic
environment:
MONGO_INITDB_ROOT_USERNAME: dev
Expand Down Expand Up @@ -52,19 +52,15 @@ jobs:
name: "Unit Tests"
command: |
source /usr/local/share/virtualenvs/tap-mongodb/bin/activate
pip install pymongo==3.8.0
nosetests tests/unittests/
- run:
name: 'Integration Tests'
command: |
source tap-tester.env
source /usr/local/share/virtualenvs/tap-tester/bin/activate
run-test --tap=tap-mongodb \
--target=target-stitch \
--orchestrator=stitch-orchestrator \
[email protected] \
--password=$SANDBOX_PASSWORD \
--client-id=50 \
tests
pip install pymongo==3.8.0
run-test --tap=tap-mongodb tests
- slack/notify-on-failure:
only_for_branches: master

Expand Down
10 changes: 2 additions & 8 deletions tests/test_mongodb_datatype.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -232,8 +231,8 @@ def test_run(self):
record_id = None
with get_test_connection() as client:
record_id = str([x for x in client['datatype_db']['datatype_coll_1'].find()][0]['_id'])


expected_record = {
"javaScript_field": "var x, y, z;",
"timestamp_field": "2019-08-15T19:25:57.000000Z",
Expand Down Expand Up @@ -263,8 +262,3 @@ def test_run(self):
}

self.assertEquals(expected_record, records_by_stream['datatype_coll_1']['messages'][1]['data'])




SCENARIOS.add(MongoDBDatatype)
3 changes: 0 additions & 3 deletions tests/test_mongodb_discovery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -220,5 +219,3 @@ def test_run(self):

# no forced-replication-method metadata
self.assertNotIn('forced-replication-method', stream_metadata.keys())

SCENARIOS.add(MongoDBDiscovery)
3 changes: 0 additions & 3 deletions tests/test_mongodb_full_table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -301,5 +300,3 @@ def test_run(self):

# version matches the target version
self.assertEqual(records_by_stream[self.tap_stream_id_to_stream()[tap_stream_id]]['table_version'], second_versions[tap_stream_id])

SCENARIOS.add(MongoDBFullTable)
3 changes: 0 additions & 3 deletions tests/test_mongodb_full_table_id.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -204,5 +203,3 @@ def test_run(self):
for tap_stream_id in self.expected_check_streams():
self.assertIsNone(final_state['bookmarks'][tap_stream_id].get('last_id_fetched'))
self.assertIsNone(final_state['bookmarks'][tap_stream_id].get('max_id_value'))

SCENARIOS.add(MongoDBFullTableID)
3 changes: 0 additions & 3 deletions tests/test_mongodb_full_table_interruptible.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -207,5 +206,3 @@ def test_run(self):
state = menagerie.get_state(conn_id)
for tap_stream_id, stream_bookmarks in state.get('bookmarks', {}).items():
self.assertTrue(stream_bookmarks.get('initial_full_table_complete', False))

SCENARIOS.add(MongoDBFullTableInterruptible)
5 changes: 0 additions & 5 deletions tests/test_mongodb_incremental.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -379,7 +378,3 @@ def test_run(self):
self.expected_pks())
for tap_stream_id in self.expected_sync_streams():
self.assertGreaterEqual(record_count_by_stream[tap_stream_id],self.expected_last_sync_row_counts()[tap_stream_id])



SCENARIOS.add(MongoDBIncremental)
4 changes: 0 additions & 4 deletions tests/test_mongodb_oplog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -276,6 +275,3 @@ def test_run(self):
# _ids of the documents changed
actual = set([ObjectId(x['data']['_id']) for x in records_by_stream['simple_coll_1']]).union(set([ObjectId(x['data']['_id']) for x in records_by_stream['simple_coll_2']]))
self.assertEqual(changed_ids, actual)


SCENARIOS.add(MongoDBOplog)
5 changes: 1 addition & 4 deletions tests/test_mongodb_oplog_aged_out.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -191,10 +190,8 @@ def test_run(self):
# assert that all rows in the collection were sync'd
for stream_id, row_count in self.expected_row_counts().items():
self.assertGreaterEqual(record_count_by_stream[stream_id], row_count)

# assert that each stream has a initial_full_table_complete=True bookmark
self.assertIsNotNone(final_state.get('bookmarks', {}).get('simple_db-simple_coll_1', {}).get('oplog_ts_time'))
self.assertIsNotNone(final_state.get('bookmarks', {}).get('simple_db-simple_coll_1', {}).get('oplog_ts_inc'))
self.assertTrue(final_state.get('bookmarks', {}).get('simple_db-simple_coll_1', {}).get('initial_full_table_complete'))

SCENARIOS.add(MongoDBOplogAgedOut)
3 changes: 0 additions & 3 deletions tests/test_mongodb_projection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from tap_tester.scenario import (SCENARIOS)
import tap_tester.connections as connections
import tap_tester.menagerie as menagerie
import tap_tester.runner as runner
Expand Down Expand Up @@ -286,5 +285,3 @@ def run_single_projection(self, projection_mapping):
def test_run(self):
for projection_mapping in self.projection_expected_keys_list():
self.run_single_projection(projection_mapping)

SCENARIOS.add(MongoDBProjection)

0 comments on commit 49878ec

Please sign in to comment.