-
Notifications
You must be signed in to change notification settings - Fork 167
tests: add retry conformance test framework and test always idempotent operations #450
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
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
b772454
initial tests for retry strategy conformance tests implementation
cojenco c78011e
revise helper methods to interact with Retry Test API
cojenco 09b8903
add helper to delete retry test
cojenco 2845731
handle exceptions in helper methods
cojenco e615dc9
remove try except
cojenco b7c6b4a
change payload key to instructions to align emulator change
cojenco 489643f
rename and revise to loop through each case and method
cojenco c6c3fff
wip populate resources to conf tests
cojenco 6281e70
add logic to populate fixture resources
cojenco c595aa5
add helper method to populate fixture hmacy key
cojenco 294b084
revise endpoints and 2 clients
cojenco 7e8bd06
add assertions to testdata scenarios
cojenco d4ed764
add logic for preconditions wip
cojenco b59c39d
add mapping scenarios and formatting for readability
cojenco cca0c65
add library methods to method invocation mapping and json
cojenco dcb2f09
lint
cojenco 5b33dc2
refactor using **kwargs
cojenco 11d9ee1
remove unused module and fix lint
cojenco 70c6501
Merge branch 'master' into retry-conf-tests
cojenco ee61aab
handle misused arguments following style guide
cojenco 694ae33
handle unused arguments
cojenco e9cf5b1
wip: add library methods to mapping and json
cojenco ffe7183
add client_options to resource populating client
cojenco cba9d13
log warnings and revise try except blocks
cojenco 15567c2
update schema for S1 and S2
cojenco e7a7e34
Merge branch 'master' into retry-conf-tests
cojenco 952769b
fix lint and mark error
cojenco 6c31f01
move retry conformance tests to separate folder
cojenco cf092fc
update noxfile
cojenco 95a3cc8
relocate conformance tests
cojenco 90b586d
add S1 S2 tests and delete json file
cojenco 0e051fe
lint and clean comments
cojenco b121df3
add S2 object library methods
cojenco ca5ab24
Merge branch 'master' into retry-conf-tests
cojenco 996534b
Merge branch 'master' into retry-conf-tests
cojenco 77e79cc
address comments
cojenco f49b30f
change test parametrization to separate test cases and address comments
cojenco de3ee4b
add assertion message and display library method name
cojenco 9717daf
Merge branch 'master' into retry-conf-tests
cojenco 9f123f5
Merge branch 'retry-conf-tests' of github.com:googleapis/python-stora…
cojenco b4096a2
add multiple lib methods and revise assertion message
cojenco e49a9d2
add S2 entry library methods after emulator fix
cojenco 9483381
Merge branch 'master' into retry-conf-tests
cojenco fb24d47
Merge branch 'retry-conf-tests' of github.com:googleapis/python-stora…
cojenco 8fe60c1
Merge branch 'master' into retry-conf-tests
cojenco 90a0438
address comments
cojenco 0a6de71
Merge branch 'master' into retry-conf-tests
cojenco 05fc261
revise test case structure using python globals
cojenco 083f61a
Merge branch 'master' into retry-conf-tests
cojenco d70b44b
revise library methods naming to start with class name
cojenco 0e8a111
unify library method signatures
cojenco efc75cc
cleanup code
cojenco 1ff387c
use pytest fixtures to populate resources
cojenco 53b9f7d
Merge branch 'master' into retry-conf-tests
cojenco cfe0168
Merge branch 'master' of github.com:googleapis/python-storage into re…
cojenco 994a2f6
address comments and update docstrings
cojenco f35cced
address comments. change to use anonymous credentials
cojenco f0586e3
Merge branch 'master' into retry-conf-tests
cojenco eb8b9bf
Merge branch 'master' into retry-conf-tests
cojenco 0b52219
update descriptions
cojenco 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Copyright 2021 Google LLC | ||
| # | ||
| # 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. | ||
|
|
||
| import io | ||
| import json | ||
| import os | ||
|
|
||
|
|
||
| def _read_local_json(json_file): | ||
| here = os.path.dirname(__file__) | ||
| json_path = os.path.abspath(os.path.join(here, json_file)) | ||
| with io.open(json_path, "r", encoding="utf-8-sig") as fileobj: | ||
| return json.load(fileobj) |
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,262 @@ | ||
| { | ||
| "retryStrategyTests": [ | ||
| { | ||
| "id": 1, | ||
| "description": "always idempotent", | ||
| "cases": [ | ||
| { | ||
| "instructions": [ | ||
| "return-503", | ||
| "return-503" | ||
| ] | ||
| } | ||
| ], | ||
| "methods": [ | ||
| { | ||
| "name": "storage.bucket_acl.get", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.bucket_acl.list", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.delete", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.get", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.getIamPolicy", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.insert", | ||
| "resources": [] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.list", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.lockRententionPolicy", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.testIamPermission", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.default_object_acl.get", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.default_object_acl.list", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.hmacKey.delete", | ||
| "resources": [] | ||
| }, | ||
| { | ||
| "name": "storage.hmacKey.get", | ||
| "resources": [] | ||
cojenco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }, | ||
| { | ||
| "name": "storage.hmacKey.list", | ||
| "resources": [] | ||
| }, | ||
| { | ||
| "name": "storage.notifications.delete", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "NOTIFICATION" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.notifications.get", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "NOTIFICATION" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.notifications.list", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "NOTIFICATION" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.object_acl.get", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.object_acl.list", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.get", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.list", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.serviceaccount.get", | ||
| "resources": [] | ||
| } | ||
| ], | ||
| "preconditionProvided": false, | ||
| "expectSuccess": true | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "description": "conditionally idempotent retries when precondition is present", | ||
| "cases": [ | ||
| { | ||
| "instructions": [ | ||
| "return-503", | ||
| "return-503" | ||
| ] | ||
| } | ||
| ], | ||
| "methods": [ | ||
| { | ||
| "name": "storage.buckets.patch", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.setIamPolicy", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.buckets.update", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.hmacKey.update", | ||
| "resources": [] | ||
| }, | ||
| { | ||
| "name": "storage.objects.compose", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.copy", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.delete", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.insert", | ||
| "resources": [ | ||
| "BUCKET" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.patch", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.rewrite", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| }, | ||
| { | ||
| "name": "storage.objects.update", | ||
| "resources": [ | ||
| "BUCKET", | ||
| "OBJECT" | ||
| ] | ||
| } | ||
| ], | ||
| "preconditionProvided": true, | ||
| "expectSuccess": true | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "description": "conditionally idempotent no retries when precondition is absent", | ||
| "cases": [ | ||
| { | ||
| "instructions": [] | ||
| } | ||
| ], | ||
| "methods": [], | ||
| "preconditionProvided": false, | ||
| "expectSuccess": false | ||
| }, | ||
| { | ||
| "id": 4, | ||
| "description": "non idempotent", | ||
| "cases": [ | ||
| { | ||
| "instructions": [] | ||
| } | ||
| ], | ||
| "methods": [], | ||
| "preconditionProvided": false, | ||
| "expectSuccess": false | ||
| } | ||
| ] | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.