Skip to content
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

Review mocking for data_tools for test_get_video_frame_from_task unit test #1560

Open
anthony-chaudhary opened this issue Oct 17, 2023 · 0 comments

Comments

@anthony-chaudhary
Copy link
Member

anthony-chaudhary commented Oct 17, 2023

It appears to simply be that that test bucket was deleted and that therefore the test fails:
google.api_core.exceptions.NotFound: 404 GET https://storage.googleapis.com/storage/v1/b/***?projection=noAcl&prettyPrint=false: The specified bucket does not exist.1

However, instead of spot treating this, we should be mocking that part of it for the scope of getting the video frame. Not testing GCP bucket here.Then if needed separately testing the GCP bucket / remote URL bucket directly. Since the test is just testing the request/response, it's not like its' getting the raw bytes of an image and testing that side of it.

[2023-10-17 20:06:11,264] ERROR data_tools_core_gcp.py Line 42: Error intializing GCP Client
ERROR [shared] Error intializing GCP Client
Traceback (most recent call last):
  File "/__w/diffgram/diffgram/shared/data_tools_core_gcp.py", line [34](https://github.com/diffgram/diffgram/actions/runs/6552236449/job/17795115549#step:20:35), in __init__
    self.bucket = self.gcs.get_bucket(settings.CLOUD_STORAGE_BUCKET)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/client.py", line [39](https://github.com/diffgram/diffgram/actions/runs/6552236449/job/17795115549#step:20:40)4, in get_bucket
    bucket.reload(
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/bucket.py", line 996, in reload
    super(Bucket, self).reload(
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/_helpers.py", line 218, in reload
    api_response = client._connection.api_request(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/cloud/storage/_http.py", line 63, in api_request
    return call()
           ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/api_core/retry.py", line 349, in retry_wrapped_func
    return retry_target(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/api_core/retry.py", line 191, in retry_target
    return target()
           ^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/google/cloud/_http.py", line [48](https://github.com/diffgram/diffgram/actions/runs/6552236449/job/17795115549#step:20:49)4, in api_request
    raise exceptions.from_http_response(response)

https://github.com/diffgram/diffgram/actions/runs/6552236449/job/17795115549

@anthony-chaudhary anthony-chaudhary changed the title Review GCP credentials for test_get_video_frame_from_task unit test Review mocking for data_tools for test_get_video_frame_from_task unit test Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant