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

test(storage): init retry conformance test scaffolding #4711

Merged
merged 36 commits into from Oct 18, 2021

Conversation

BrennaEpp
Copy link
Contributor

  • adds conformance test scaffolding
  • updates conformance test proto
  • adds retry test json with scenario 1 tests

@BrennaEpp BrennaEpp requested a review from a team August 31, 2021 22:40
@BrennaEpp BrennaEpp requested a review from a team as a code owner August 31, 2021 22:40
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Aug 31, 2021
@google-cla
Copy link

google-cla bot commented Aug 31, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 31, 2021
@google-cla
Copy link

google-cla bot commented Aug 31, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 31, 2021
@tritone tritone requested review from tritone and a team September 10, 2021 19:27
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Generally looks good! A few comments for clarification.

storage/internal/test/conformance/test.pb.go Show resolved Hide resolved
"PATH_STYLE": 0,
"VIRTUAL_HOSTED_STYLE": 1,
"BUCKET_BOUND_HOSTNAME": 2,
func (x UrlStyle) Enum() *UrlStyle {
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious about these updates in the generated code-- do the signed URL tests still work as-is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, looks like it! these updates are from the conformance tests repo

storage/conformance_test.go Outdated Show resolved Hide resolved
storage/conformance_test.go Outdated Show resolved Hide resolved
t.Run(testName, func(t *testing.T) {

// Create the retry subtest
subtest := &retrySubtest{T: t, name: testName}
Copy link
Contributor

Choose a reason for hiding this comment

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

"subtest" seems like the wrong word here-- this creates/manages a retry test in the emulator, correct? Any thoughts on a better name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I named it that as each t.Run() calls each function it runs a subtest and this struct is used throughout this functio, but yeah there is probably a better name for it.
Maybe something like emulatorRetryTest?

storage/conformance_test.go Outdated Show resolved Hide resolved
storage/conformance_test.go Outdated Show resolved Hide resolved
storage/conformance_test.go Outdated Show resolved Hide resolved
rt.id = testRes.TestID

// Create wrapped client which will send emulator instructions
rt.host.Path = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good! Curious is the main purpose of creating a wrappedClient in here to populate the retrySubtest struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The wrappedClient adds the retry test header to each request, prints the request if the test fails and also adds the DevstorageFullControlScope to the https client transport. Correct, we do create it here to populate the struct

Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few questions and nits.

Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

One minor suggestion, overall looking ready to merge! Thanks for all your work on this.

// Create necessary test resources in the emulator
fs := &resources{}
for _, resource := range method.Resources {
if err := fs.populate(ctx, client, resource); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should populating the resources be a method on the subtest as well? Not required but it feels slightly cleaner I guess.

Copy link
Contributor

@cojenco cojenco left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@BrennaEpp BrennaEpp merged commit 44bc953 into googleapis:master Oct 18, 2021
@BrennaEpp BrennaEpp deleted the conf-scaffolding branch March 23, 2022 19:07
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 Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants