grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

Add test for custom xDS resource subscription

Open dfawley opened this issue 6 months ago • 1 comments

It seems we have missing test coverage due to the failure in internal bug b/427286972. We should make sure we have proper coverage here.

dfawley avatar Jul 14 '25 20:07 dfawley

The xDS client accepts a list of supported resource types as part of its configuration at creation time here: https://github.com/grpc/grpc-go/blob/e8167363406cc5a2da7befab1bfc5e4c21bdd264/internal/xds/clients/xdsclient/xdsconfig.go#L60

We need a simple test where

  • We define a custom xDS resource type implementation
  • Create an xDS client with the above resource type implementation in the configuration passed to it
  • Configure a resource of this type in the management server
  • Create a watch for the above resource type from the xDS client
  • Verify that the resource can be successfully parsed and the update is returned to the watcher

We would also need to have tests for error cases, where resource parsing fails.

easwars avatar Nov 13 '25 19:11 easwars