-
Notifications
You must be signed in to change notification settings - Fork 396
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
test(storage): add utils for new gcs emulator #5057
Conversation
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.
A few nits below. Do you think we should be writing unit tests for this new code? It is complex enough that maybe we should.
Reviewed 6 of 6 files at r1.
Reviewable status: all files reviewed, 11 unresolved discussions (waiting on @vnvo2409)
google/cloud/storage/emulator/requirements.txt, line 5 at r1 (raw file):
flask==1.1.2 grpc-google-iam-v1==0.12.3 pysimdjson==3.0.0
missing newlines at the end of the file?
google/cloud/storage/emulator/utils/init.py, line 1 at r1 (raw file):
# Copyright 2020 Google Inc.
s/Google Inc./Google LLC/ here and below.
google/cloud/storage/emulator/utils/acl.py, line 1 at r1 (raw file):
# Copyright 2020 Google Inc.
s/Google Inc./Google LLC/
google/cloud/storage/emulator/utils/acl.py, line 14 at r1 (raw file):
# See the License for the specific language governing permissions and # limitations under the License. """Utils related to access control"""
nit: blank line after copyright boiler plate?
google/cloud/storage/emulator/utils/acl.py, line 22 at r1 (raw file):
from google.cloud.storage_v1.proto import storage_resources_pb2 as resources_pb2 PROJECT_NUMBER = os.getenv("GCS_EMULATOR_PROJECT_NUMBER", "123456789")
We are trying to prefix all environment variables with GOOGLE_CLOUD_CPP_<SERVICE>
, please use GOOGLE_CLOUD_CPP_STORAGE_EMULATOR_PROJECT_NUMBER
google/cloud/storage/emulator/utils/acl.py, line 24 at r1 (raw file):
PROJECT_NUMBER = os.getenv("GCS_EMULATOR_PROJECT_NUMBER", "123456789") OBJECT_OWNER_ENTITY = os.getenv( "GCS_EMULATOR_OBJECT_OWNER_ENTITY", "user-object.owners@gmail.com"
can we use user-object.owners@example.com
to avoid emailing some real person? same comments about environment variables.
google/cloud/storage/emulator/utils/acl.py, line 27 at r1 (raw file):
) OBJECT_READER_ENTITY = os.getenv( "GCS_EMULATOR_OBJECT_READER_ENTITY", "user-object.viewers@gmail.com"
Ditto.
google/cloud/storage/emulator/utils/common.py, line 1 at r1 (raw file):
# Copyright 2020 Google Inc.
s/Google Inc./Google LLC/
google/cloud/storage/emulator/utils/common.py, line 14 at r1 (raw file):
# See the License for the specific language governing permissions and # limitations under the License. """Common utils"""
nit: blank line.
google/cloud/storage/emulator/utils/error.py, line 1 at r1 (raw file):
# Copyright 2020 Google Inc.
s/Google Inc./Google LLC/
google/cloud/storage/emulator/utils/error.py, line 14 at r1 (raw file):
# See the License for the specific language governing permissions and # limitations under the License. """Utils to raise error code and abort the server"""
nit: blank line?
Codecov Report
@@ Coverage Diff @@
## master #5057 +/- ##
=======================================
Coverage 94.03% 94.03%
=======================================
Files 983 983
Lines 76452 76453 +1
=======================================
+ Hits 71888 71894 +6
+ Misses 4564 4559 -5
Continue to review full report at Codecov.
|
I will add tests in the next PR |
google/cloud/storage/emulator/utils/init.py, line 1 at r1 (raw file): Previously, coryan (Carlos O'Ryan) wrote…
nit: next time you go through these files, no |
I copied the style of |
Later is fine. |
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.
Thanks. Yes, the copyright notice format changed, and we are not supposed to change the old ones 🤷♂️
Reviewed 4 of 4 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved
This PR adds some utils for the new emulator ( I prefer emulator over testbench ):
acl.py
: utils related to access control listerror.py
: a common interface to return error code for both REST and gRPCcommon.py
: common utils used by both gRPC and REST.The generated protos will be installed via
pip
from googleapis/python-storage#270This PR is a part of #4751
This change is