-
Notifications
You must be signed in to change notification settings - Fork 473
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
Certification test for Azure CosmosDB Statestore #1972
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1972 +/- ##
==========================================
- Coverage 37.71% 37.67% -0.04%
==========================================
Files 192 192
Lines 24016 24016
==========================================
- Hits 9058 9049 -9
- Misses 14189 14199 +10
+ Partials 769 768 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
assert.Equal(t, expectedValue, string(item.Value)) | ||
|
||
// delete state | ||
err = client.DeleteState(ctx, statestore, stateKey, setMeta) |
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.
Should we also try to delete with wrong partition key and assert error?
|
||
## Test plan | ||
|
||
### Basic Test using master key authentication |
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.
Please remove this. It's already covered by conformance tests.
|
||
### Test Partition Keys | ||
Ensure the following scenarios: | ||
1. In case of invalid partition key, the access fails |
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.
Access? That sounds like it's about authorization.. but that's not so.
Please be specific that this is about a Get or Set operation.
1. Able to create and test connection. | ||
2. Able to do set, fetch and delete. | ||
|
||
### Test Partition Keys |
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.
Please add a test where you are connecting to a different collection -- a collection which does not use the expected /partitionKey
partition key. We want to assert the failure for that case. This is a common problem.
To do so, please add a new collection with wrong partition name here:
https://github.com/dapr/components-contrib/blob/master/.github/infrastructure/conformance/azure/conf-test-azure-cosmosdb.bicep#L44
Then also make sure to update the following so that the second collection name gets exported to the KeyVault where we save these configurations
https://github.com/dapr/components-contrib/blob/master/.github/infrastructure/conformance/azure/conf-test-azure.bicep
https://github.com/dapr/components-contrib/blob/master/.github/infrastructure/conformance/azure/setup-azure-conf-test.sh
Lastly, set up a new component YAML talking to the collection with the bad partition name. And make sure to reference the new environment variable you are creating above.
Don't forget to inject that environment variable into the workflow run via the required-secrets section!
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.
To provide more context -- what you have described is only impacting partition key values, but the Cosmos DB state store requires that the Cosmos DB collection was setup with a partition Key that is exactly called /partitionKey
. It will be good to assert the failure when the collection has been set up wrong.
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.
Please also add tests that check the handling of null data, empty string - especially with different content types specified.
@berndverst should the nil, empty string test be part of conformance tests? |
@berndverst Please advise, does it make sense to include this test as well? : |
Ok to skip, I am going to add it here: #1992 |
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.
@shivamkm07 please address review comments.
Signed-off-by: shivam <[email protected]>
Signed-off-by: shivam <[email protected]>
Signed-off-by: Bernd Verst <[email protected]>
e029f31
to
6a6c465
Compare
Signed-off-by: Bernd Verst <[email protected]>
6a6c465
to
fcfcda7
Compare
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 depend on this PR to upgrade the Track2 SDK. Therefore I will merge this now -- I fixed this up as necessary.
* Certification test for Azure CosmosDB Signed-off-by: shivam <[email protected]> * Updating go.mod Signed-off-by: shivam <[email protected]> * make motidy-all Signed-off-by: Bernd Verst <[email protected]> * CosmosDB Cert Test: Apply Dapr Runtime updates, Go version update etc Signed-off-by: Bernd Verst <[email protected]> Signed-off-by: shivam <[email protected]> Signed-off-by: Bernd Verst <[email protected]> Co-authored-by: Bernd Verst <[email protected]> Signed-off-by: Bernd Verst <[email protected]>
* Certification test for Azure CosmosDB Signed-off-by: shivam <[email protected]> * Updating go.mod Signed-off-by: shivam <[email protected]> * make motidy-all Signed-off-by: Bernd Verst <[email protected]> * CosmosDB Cert Test: Apply Dapr Runtime updates, Go version update etc Signed-off-by: Bernd Verst <[email protected]> Signed-off-by: shivam <[email protected]> Signed-off-by: Bernd Verst <[email protected]> Co-authored-by: Bernd Verst <[email protected]>
Signed-off-by: shivam [email protected]
Description
Certification test for Azure CosmosDB statestore
Issue reference
Please reference the issue this PR will close: #1138
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: