-
Notifications
You must be signed in to change notification settings - Fork 349
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
Add testbench support for GCS+gRPC #4751
Comments
@coryan
Because it is a large project, I have created a new repository for it https://github.com/vnvo2409/gcs-testbench I have some questions:
|
Really cool, thanks!
Please remember to include the right license and copyright notices in this code. The majority of that code is owned by Google, and the License requires that you reproduce the Copyright notice in any copies of the code: Lines 89 to 128 in 8d87874
There may be some interest in doing that, let's ask @frankyn if he can suggest a repository to host the testbench separately.
There are also examples (in |
if we make it into a long term project, I will consider switching to Go since there are libraries allow us to run http and grpc in the same port |
@coryan |
We discussed this internally, we would prefer to keep this in |
I got 30/32 integration tests passed.
Since I didn't follow the current testbench strictly, the new testbench is not perfect. It will need more improvements and I will tell you when it is ready to use. |
Thanks for the update!
|
A quick question about When we send a
|
I expect that GCS+gRPC will also (a) return OK when the upload is started, regardless of the pre-conditions, (b) save the preconditions on the server side, maybe encoded in the upload id too (say base64 encoded), and (c) will check them at the end.
Yes.
I do not see how that would work. Consider |
The new testbench is almost done. My questions:
|
Awesome.
Can you tell me what is "quite large"? How many lines of changes? If it is over 500 lines it might be best to split it, maybe one PR to introduce the gRPC components (without using them at first). Would it be possible to then split even further, say one that uses gRPC for buckets (but nothing else) and then another for objects? Or maybe something along those lines, you would know better what is a good split.
Please remind me: are these generated on the fly by the build system or do we need to commit them to the code? Can we install them via pip?
We are trying to enable at least one build to run against production using gRPC. That requires disabling a few tests here and there because production has gaps between gRPC and REST. I think this is orthogonal to your changes.
I think so, thanks for checking. |
The testbench has been rewritten from scratch, mainly to keep the compatibility between REST and GRPC. Here is the philosophy behind the testbench:
You could take a look here https://github.com/vnvo2409/gcs-testbench/tree/refactor. I haven't done the cleanup yet but It could give you a general idea about what I am doing. (
These files are used by the testbench so it could be either generated on the fly or commit them to the code. But I think commit them to the code will be much easier. About the pip, I can't find any package but I think you could ask internally about it. pip is the best way of course.
This test for example. google-cloud-cpp/google/cloud/storage/tests/object_integration_test.cc Lines 806 to 810 in 387409c
To me, |
Looks like over 2,900 lines of changes, definitely we need to split this in several PRs.
Okay, that sounds sensible, but I guess pushes complexity into the
SGTM.
SGTM too. Maybe this is a good start can you create a PR to make this change to most functions? This is just a suggestion, you would know better how to start the changes.
That SGTM also. Maybe another good place to start.
Well, one way to do it is to:
That is true for most builds, but we are preparing a build that will set // TODO(#...) - production does not support DeleteResumableUpload() yet.
if (!UsingTestbench() && UsingGrpc()) GTEST_SKIP(); Or maybe we get to remove the code. |
A series of PRs will take some time to complete. I think it will finish by October.
How about the generated files ? |
Trying to find if there are any. I would prefer to generate them on the fly over committing them, and I would prefer to use pip over generating them. |
I will work on this feature by extending Python client to support GCS+gRPC with a different endpoint (
/grpc
).The changes will be:
GrpcClient
to work with different endpoint when testing with testbench./grpc
endpoint to testbench.CreateBucket()
cc @coryan
The text was updated successfully, but these errors were encountered: