-
Notifications
You must be signed in to change notification settings - Fork 286
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
Cosmos partitioned - Parity with C# and Node | Also storage base tests #459
Merged
Conversation
This file contains 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
- added storage_base_tests - added test_cosmos_partitioned_storage
- added storage_base_tests - added test_cosmos_partitioned_storage
mdrichardson
changed the title
Cosmos partitioned - Parity with C# (merged) and Node (unmerged)
Cosmos partitioned - Parity with C# and Node | Also storage base tests
Nov 27, 2019
We should consider the use of CosmosDbKeyEscape.sanitize_key and whether or not 255 is an actual requirement by the libraries used for this. |
axelsrz
reviewed
Dec 2, 2019
axelsrz
approved these changes
Dec 3, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is kind of two PRs in one.
1
Fixes #327
Add
cosmosdb_paritioned_storage
for parity with both C# and Node2
Parity with: microsoft/botbuilder-js#1371
The Dotnet repo has a StorageBaseTests class that all of the Storage classes borrow from to reduce duplicate code and ensure that the Storage classes all pass a base set of tests.
Python SDK doesn't have this. Instead, there's a ton of duplicate code...until now!
Specific Changes
This doesn't remove any tests from any of the storage providers. Instead, it replaces them with equivalent tests and in some cases, adds a few for tests that probably should have been conducted, but weren't.
storage_base_tests
class tobotbuilder-testing
for parity w/ Dotnet, which Memory, Blob, Cosmos, and CosmosPartitioned storage providers now implement in addition to their own tests (mostly constructor argument checks)botbuilder-core
, but I couldn't seem to make that work in Python without too many additional__init__
s. Maybe somebody who isn't Python-dumb can help?Changes Worth a Closer Look
testRan
check. Is this necessary? I'd seen it used in some dotnet tests and thought it might be worthwhile since there aren'tassert
checks in most of the individual provider's tests.StoreItems
. This shouldn't be the case, so I changed fromitem.e_tag
toif hasattr(item, "e_tag") <use it> else item.get("e_tag")
in a LOT of places.deepcopy()
s on write, which I think is related to this PRitem["id"] = blob.name
, in read(), because it would overwrite an item that had thatid
set and didn't seem to make any tests fail when changing itTesting
CoreBot works w/ MemoryStorage:
CoreBot works w/ Blob:
CoreBot works w/ Cosmos:
CoreBot works w/ CosmosPartitioned: