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

cleanup: replace grpc.Dial with grpc.NewClient in tests #7640

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

hanut19
Copy link
Contributor

@hanut19 hanut19 commented Sep 17, 2024

Partially address: #7049

Update tests where only direct replacement is enough to replace grpc.Dial with grpc.NewClient in test files

RELEASE NOTES: None

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.81%. Comparing base (bcf9171) to head (2529133).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7640      +/-   ##
==========================================
+ Coverage   81.79%   81.81%   +0.01%     
==========================================
  Files         361      361              
  Lines       27821    27821              
==========================================
+ Hits        22757    22761       +4     
+ Misses       3863     3858       -5     
- Partials     1201     1202       +1     

see 16 files with indirect coverage changes

@hanut19 hanut19 changed the title replace grpc.Dial with grpc.NewClient in test files .*: replace grpc.Dial with grpc.NewClient in test files Sep 18, 2024
if err != nil {
log.Fatalf("Failed to dial: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

failed to create new client

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 please check

@@ -847,7 +847,7 @@ func (s) TestEDS_ClusterResourceUpdates(t *testing.T) {
t.Fatalf("Timeout when waiting for old EDS watch %q to be canceled and new one %q to be registered", edsServiceName, clusterName)
}

// Make an RPC, and ensure that it gets routed to second backend,
Copy link
Contributor

Choose a reason for hiding this comment

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

why change this? an is ok in this case

Copy link
Contributor

Choose a reason for hiding this comment

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

@hanut19 please revert this

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 please check.

@@ -57,9 +57,9 @@ func (s) TestNoNonEmptyTargetsReturnsError(t *testing.T) {
r := startManualResolverWithConfig(t, rlsConfig)

// Dial the backend.
Copy link
Contributor

Choose a reason for hiding this comment

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

Above comment Dial the backend should change to Create new client. Applicable everywhere

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 please check

if err != nil {
t.Fatalf("grpc.Dial() failed: %v", err)
t.Fatalf("grpc.NewClient() failed: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Failed to create gRPC client. Change everywhere else as well

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 please check

@purnesh42H
Copy link
Contributor

@hanut19 please close the other PR

@purnesh42H purnesh42H added Area: Documentation Includes examples and docs. Type: Testing Area: Testing Includes tests and testing utilities that we have for unit and e2e tests within our repo. and removed Area: Documentation Includes examples and docs. labels Sep 20, 2024
@purnesh42H purnesh42H added this to the 1.68 Release milestone Sep 20, 2024
@hanut19 hanut19 force-pushed the replace-dial-with-newclient branch from 1fc951b to 04af399 Compare September 20, 2024 12:15
@dfawley dfawley changed the title .*: replace grpc.Dial with grpc.NewClient in test files cleanup: replace grpc.Dial with grpc.NewClient in test files Sep 20, 2024
@hanut19 hanut19 force-pushed the replace-dial-with-newclient branch from 04af399 to 2529133 Compare September 24, 2024 04:58
@purnesh42H purnesh42H assigned dfawley and unassigned hanut19 Sep 24, 2024
@purnesh42H
Copy link
Contributor

@dfawley for second review

@dfawley dfawley changed the title cleanup: replace grpc.Dial with grpc.NewClient in test files cleanup: replace grpc.Dial with grpc.NewClient in tests Sep 24, 2024
@dfawley dfawley merged commit e7a8097 into grpc:master Sep 24, 2024
14 checks passed
janardhanvissa pushed a commit to janardhanvissa/grpc-go that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Testing Includes tests and testing utilities that we have for unit and e2e tests within our repo. Type: Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants