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

xds: switching to stubserver in tests instead of testservice implementation #7726

Merged
merged 17 commits into from
Nov 13, 2024

Conversation

janardhanvissa
Copy link
Contributor

Partially Addresses: #7291

RELEASE NOTES: None

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.66%. Comparing base (d66fc3a) to head (e5a21ea).
Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7726      +/-   ##
==========================================
- Coverage   81.71%   81.66%   -0.05%     
==========================================
  Files         374      374              
  Lines       38166    37978     -188     
==========================================
- Hits        31188    31016     -172     
+ Misses       5699     5643      -56     
- Partials     1279     1319      +40     

see 52 files with indirect coverage changes

xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@purnesh42H purnesh42H left a comment

Choose a reason for hiding this comment

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

lgtm

@purnesh42H purnesh42H assigned easwars and unassigned janardhanvissa Oct 29, 2024
@purnesh42H
Copy link
Contributor

@easwars for second review

xds/internal/httpfilter/fault/fault_test.go Show resolved Hide resolved
xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
xds/internal/httpfilter/fault/fault_test.go Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
Comment on lines 289 to 287
server, err := xds.NewGRPCServer(grpc.Creds(insecure.NewCredentials()), modeChangeOpt, xds.BootstrapContentsForTesting(bootstrapContents))
if err != nil {
t.Fatalf("Failed to create an xDS enabled gRPC server: %v", err)
}
defer server.Stop()
testgrpc.RegisterTestServiceServer(server, &testService{})

stub.S = server
stubserver.StartTestService(t, stub)
Copy link
Member

Choose a reason for hiding this comment

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

same comment as before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

combined server initialization and passed sopts to StartTestService.

@arvindbr8
Copy link
Member

@janardhankrishna-sai -- Also please mention the PR description why does this diff "partially" fix the issue. The last few comments in #7291 is also not very clear.

xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
@janardhanvissa
Copy link
Contributor Author

@janardhankrishna-sai -- Also please mention the PR description why does this diff "partially" fix the issue. The last few comments in #7291 is also not very clear.

xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
Copy link
Member

@arvindbr8 arvindbr8 left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes per conversations. I just had a few more comments, please take a look.

xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/server_ext_test.go Outdated Show resolved Hide resolved
xds/internal/httpfilter/fault/fault_test.go Outdated Show resolved Hide resolved
Copy link
Member

@arvindbr8 arvindbr8 left a comment

Choose a reason for hiding this comment

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

LGTM, modulo couple of suggestions

Comment on lines 116 to 118
t.Cleanup(func() {
stub.S.Stop()
})
Copy link
Member

Choose a reason for hiding this comment

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

This should also work

Suggested change
t.Cleanup(func() {
stub.S.Stop()
})
t.Cleanup(stub.S.Stop)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done with the change.

fs, nodeID, port, cleanup := clientSetup(t)
defer cleanup()
fs, nodeID, port := clientSetup(t)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed empty line

@purnesh42H purnesh42H merged commit 8c518f7 into grpc:master Nov 13, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants