-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-2318 Atlas Data Lake testing #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
prashantmital
merged 11 commits into
mongodb:master
from
prashantmital:PYTHON-2318/datalake-testing
Dec 17, 2020
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a3b9412
PYTHON-2318 Atlas Data Lake testing
prashantmital 5bbfbfa
Patch 1
prashantmital 5a6e354
improvements
prashantmital 87f2443
Fixes
prashantmital 86d1178
make test.data_lake discoverable in python 2.x
prashantmital 6b863c7
avoid failures when TLS is enabled
prashantmital 8949542
review comments
prashantmital c6da5c9
fix test skipping logic
prashantmital ab07ce7
cleanup
prashantmital bb5589e
refactor crud runner
prashantmital e1daf44
more review 2
prashantmital File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2020-present MongoDB, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""v2 format CRUD test runner. | ||
|
||
https://github.com/mongodb/specifications/blob/master/source/crud/tests/README.rst | ||
""" | ||
|
||
from test.utils_spec_runner import SpecRunner | ||
|
||
|
||
class TestCrudV2(SpecRunner): | ||
# Default test database and collection names. | ||
TEST_DB = None | ||
TEST_COLLECTION = None | ||
|
||
def get_scenario_db_name(self, scenario_def): | ||
"""Crud spec says database_name is optional.""" | ||
return scenario_def.get('database_name', self.TEST_DB) | ||
|
||
def get_scenario_coll_name(self, scenario_def): | ||
"""Crud spec says collection_name is optional.""" | ||
return scenario_def.get('collection_name', self.TEST_COLLECTION) | ||
|
||
def get_object_name(self, op): | ||
"""Crud spec says object is optional and defaults to 'collection'.""" | ||
return op.get('object', 'collection') | ||
|
||
def get_outcome_coll_name(self, outcome, collection): | ||
"""Crud spec says outcome has an optional 'collection.name'.""" | ||
return outcome['collection'].get('name', collection.name) | ||
|
||
def setup_scenario(self, scenario_def): | ||
"""Allow specs to override a test's setup.""" | ||
# PYTHON-1935 Only create the collection if there is data to insert. | ||
if scenario_def['data']: | ||
super(TestCrudV2, self).setup_scenario(scenario_def) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"collection_name": "driverdata", | ||
"database_name": "test", | ||
"tests": [ | ||
{ | ||
"description": "Aggregate with pipeline (project, sort, limit)", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "aggregate", | ||
"arguments": { | ||
"pipeline": [ | ||
{ | ||
"$project": { | ||
"_id": 0 | ||
} | ||
}, | ||
{ | ||
"$sort": { | ||
"a": 1 | ||
} | ||
}, | ||
{ | ||
"$limit": 2 | ||
} | ||
] | ||
}, | ||
"result": [ | ||
{ | ||
"a": 1, | ||
"b": 2, | ||
"c": 3 | ||
}, | ||
{ | ||
"a": 2, | ||
"b": 3, | ||
"c": 4 | ||
} | ||
] | ||
} | ||
], | ||
"expectations": [ | ||
{ | ||
"command_started_event": { | ||
"command": { | ||
"aggregate": "driverdata" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"collection_name": "driverdata", | ||
"database_name": "test", | ||
"tests": [ | ||
{ | ||
"description": "estimatedDocumentCount succeeds", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "estimatedDocumentCount", | ||
"result": 15 | ||
} | ||
], | ||
"expectations": [ | ||
{ | ||
"command_started_event": { | ||
"command": { | ||
"count": "driverdata" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"collection_name": "driverdata", | ||
"database_name": "test", | ||
"tests": [ | ||
{ | ||
"description": "Find with projection and sort", | ||
"operations": [ | ||
{ | ||
"object": "collection", | ||
"name": "find", | ||
"arguments": { | ||
"filter": { | ||
"b": { | ||
"$gt": 5 | ||
} | ||
}, | ||
"projection": { | ||
"_id": 0 | ||
}, | ||
"sort": { | ||
"a": 1 | ||
}, | ||
"limit": 5 | ||
}, | ||
"result": [ | ||
{ | ||
"a": 5, | ||
"b": 6, | ||
"c": 7 | ||
}, | ||
{ | ||
"a": 6, | ||
"b": 7, | ||
"c": 8 | ||
}, | ||
{ | ||
"a": 7, | ||
"b": 8, | ||
"c": 9 | ||
}, | ||
{ | ||
"a": 8, | ||
"b": 9, | ||
"c": 10 | ||
}, | ||
{ | ||
"a": 9, | ||
"b": 10, | ||
"c": 11 | ||
} | ||
] | ||
} | ||
], | ||
"expectations": [ | ||
{ | ||
"command_started_event": { | ||
"command": { | ||
"find": "driverdata" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like something that should run after
_init_client()
returns. Is there a reason it is placed here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_init_client()
relies on DB commands likegetCmdLineOpts
that are not supported by themongohoused
binary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment about that? And how does this work if mongohoused is configured with tls? Do we not test tls?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't test TLS. Added the comment.