Skip to content

Conversation

@IlyaFaer
Copy link

@IlyaFaer IlyaFaer commented Apr 2, 2020

Closes #92

Fields signingV4Tests and postPolicyV4Tests were added into url_signer_v4_test_data.json to separate signing test data from POST policies test data.

@IlyaFaer IlyaFaer added api: storage Issues related to the googleapis/python-storage API. testing labels Apr 2, 2020
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 2, 2020
"expiration": 10,
"headers": {
"x-goog-resumable": "start"
{
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of changes, but in fact I've only added signingV4Tests and postPolicyV4Tests into the json structure.

@IlyaFaer IlyaFaer requested a review from frankyn April 2, 2020 11:06
@IlyaFaer IlyaFaer marked this pull request as ready for review April 2, 2020 11:06
@IlyaFaer
Copy link
Author

IlyaFaer commented Apr 2, 2020

@frankyn, teardown failed in kokoro with 403 error:

==================================== ERRORS ====================================
_ ERROR at teardown of TestRetentionPolicy.test_bucket_w_default_event_based_hold _

self = <test_system.TestRetentionPolicy testMethod=test_bucket_w_default_event_based_hold>

    def tearDown(self):
        for bucket_name in self.case_buckets_to_delete:
            bucket = Config.CLIENT.bucket(bucket_name)
>           retry_429_harder(bucket.delete)()

tests/system/test_system.py:1709:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_utils/test_utils/retry.py:95: in wrapped_function
    return to_wrap(*args, **kwargs)
google/cloud/storage/bucket.py:1131: in delete
    client._connection.api_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <google.cloud.storage._http.Connection object at 0x7f41c87a7970>
method = 'DELETE', path = '/b/w-def-ebh-1585825330597', query_params = {}
data = None, content_type = None, headers = None, api_base_url = None
api_version = None, expect_json = True, _target_object = None, timeout = 60

    def api_request(
        self,
        method,
        path,
        query_params=None,
        data=None,
        content_type=None,
        headers=None,
        api_base_url=None,
        api_version=None,
        expect_json=True,
        _target_object=None,
        timeout=_DEFAULT_TIMEOUT,
    ):
      ...
        if not 200 <= response.status_code < 300:
>           raise exceptions.from_http_response(response)
E           google.api_core.exceptions.Conflict: 409 DELETE https://storage.googleapis.com/storage/v1/b/w-def-ebh-1585825330597: The bucket you tried to delete was not empty.

.nox/system-3-8/lib/python3.8/site-packages/google/cloud/_http.py:423: Conflict
=================================== FAILURES ===================================
__________ TestRetentionPolicy.test_bucket_w_default_event_based_hold __________

self = <test_system.TestRetentionPolicy testMethod=test_bucket_w_default_event_based_hold>

    def test_bucket_w_default_event_based_hold(self):
        ...
        self.assertIsNone(other.retention_expiration_time)

>       blob.delete()

tests/system/test_system.py:1810:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
google/cloud/storage/blob.py:630: in delete
    self.bucket.delete_blob(
google/cloud/storage/bucket.py:1189: in delete_blob
    client._connection.api_request(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <google.cloud.storage._http.Connection object at 0x7f41c87a7970>
method = 'DELETE', path = '/b/w-def-ebh-1585825330597/o/test-blob'
query_params = {'generation': 1585825333262407}, data = None
content_type = None, headers = None, api_base_url = None, api_version = None
expect_json = True, _target_object = None, timeout = 60

    def api_request(
        self,
        method,
        path,
        query_params=None,
        data=None,
        content_type=None,
        headers=None,
        api_base_url=None,
        api_version=None,
        expect_json=True,
        _target_object=None,
        timeout=_DEFAULT_TIMEOUT,
    ):
     ...

        if not 200 <= response.status_code < 300:
>           raise exceptions.from_http_response(response)
E           google.api_core.exceptions.Forbidden: 403 DELETE https://storage.googleapis.com/storage/v1/b/w-def-ebh-1585825330597/o/test-blob?generation=1585825333262407: Object 'w-def-ebh-1585825330597/test-blob' is under active Event-Based hold and cannot be deleted, overwritten or archived until hold is removed.

@frankyn
Copy link
Contributor

frankyn commented Apr 2, 2020

Tear down should clear out all retention properties and then do bucket.delete(force=True) with retries.

Could you help improve the test code there?

Copy link
Contributor

@frankyn frankyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate PR for improving system tests would be much appreciated @IlyaFaer

@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2020
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2020
@IlyaFaer
Copy link
Author

IlyaFaer commented Apr 2, 2020

Separate PR for improving system tests would be much appreciated @IlyaFaer

Sure, I'll see what I can do there
Opened an issue not to forget: #97

@frankyn frankyn merged commit 44060de into googleapis:master Apr 2, 2020
@IlyaFaer IlyaFaer deleted the conformance_tests_new_format branch April 2, 2020 18:07
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
* test: update conformance tests to fit the new format

* black reformat
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
* test: update conformance tests to fit the new format

* black reformat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update conformance tests to fit the new format

4 participants