buildBasicRLSConfigWithChildPolicy constructs a very basic service config for the RLS LB policy. It also registers a test LB policy which is capable of being a child of the RLS LB policy.
(t *testing.T, childPolicyName, rlsServerAddress string)
| 145 | // the RLS LB policy. It also registers a test LB policy which is capable of |
| 146 | // being a child of the RLS LB policy. |
| 147 | func buildBasicRLSConfigWithChildPolicy(t *testing.T, childPolicyName, rlsServerAddress string) *e2e.RLSConfig { |
| 148 | childPolicyName = "test-child-policy" + childPolicyName |
| 149 | e2e.RegisterRLSChildPolicy(childPolicyName, nil) |
| 150 | t.Logf("Registered child policy with name %q", childPolicyName) |
| 151 | |
| 152 | return &e2e.RLSConfig{ |
| 153 | RouteLookupConfig: &rlspb.RouteLookupConfig{ |
| 154 | GrpcKeybuilders: []*rlspb.GrpcKeyBuilder{{Names: []*rlspb.GrpcKeyBuilder_Name{{Service: "grpc.testing.TestService"}}}}, |
| 155 | LookupService: rlsServerAddress, |
| 156 | LookupServiceTimeout: durationpb.New(defaultTestTimeout), |
| 157 | CacheSizeBytes: 1024, |
| 158 | }, |
| 159 | RouteLookupChannelServiceConfig: `{"loadBalancingConfig": [{"pick_first": {}}]}`, |
| 160 | ChildPolicy: &internalserviceconfig.BalancerConfig{Name: childPolicyName}, |
| 161 | ChildPolicyConfigTargetFieldName: e2e.RLSChildPolicyTargetNameField, |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | // startBackend starts a backend implementing the TestService on a local port. |
| 166 | // It returns a channel for tests to get notified whenever an RPC is invoked on |
no test coverage detected