grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC
https://grpc.io
Apache License 2.0
21.08k stars 4.38k forks source link

xdsclient: improve test coverage #5553

Open easwars opened 2 years ago

easwars commented 2 years ago

While code coverage is not the best metric for how good our tests are, it is a metric. Our current code coverage for the xdsclient is average. Attempting to improve this will help improve our tests and could uncover some interesting bugs.

easwars@easwars-macbookpro3:grpc-go $ go test google.golang.org/grpc/xds/internal/xdsclient/... -coverprofile=/tmp/coverage.out
ok      google.golang.org/grpc/xds/internal/xdsclient   3.054s  coverage: 70.8% of statements
ok      google.golang.org/grpc/xds/internal/xdsclient/bootstrap 0.293s  coverage: 81.6% of statements
ok      google.golang.org/grpc/xds/internal/xdsclient/controller        1.748s  coverage: 60.4% of statements
?       google.golang.org/grpc/xds/internal/xdsclient/controller/version        [no test files]
?       google.golang.org/grpc/xds/internal/xdsclient/controller/version/v2     [no test files]
?       google.golang.org/grpc/xds/internal/xdsclient/controller/version/v3     [no test files]
ok      google.golang.org/grpc/xds/internal/xdsclient/e2e_test  0.944s  coverage: [no statements]
ok      google.golang.org/grpc/xds/internal/xdsclient/load      0.165s  coverage: 92.6% of statements
?       google.golang.org/grpc/xds/internal/xdsclient/pubsub    [no test files]
ok      google.golang.org/grpc/xds/internal/xdsclient/xdsresource       0.518s  coverage: 86.8% of statements
?       google.golang.org/grpc/xds/internal/xdsclient/xdsresource/version       [no test files]
dfawley commented 1 year ago

Shout out #1676