startServer starts a gRPC server listening. Callers should defer a call to te.tearDown to clean up.
(ss *stubserver.StubServer)
| 239 | // startServer starts a gRPC server listening. Callers should defer a |
| 240 | // call to te.tearDown to clean up. |
| 241 | func (te *test) startServer(ss *stubserver.StubServer) { |
| 242 | var opts []grpc.ServerOption |
| 243 | if te.compress == "gzip" { |
| 244 | opts = append(opts, |
| 245 | grpc.RPCCompressor(grpc.NewGZIPCompressor()), |
| 246 | grpc.RPCDecompressor(grpc.NewGZIPDecompressor()), |
| 247 | ) |
| 248 | } |
| 249 | for _, sh := range te.serverStatsHandlers { |
| 250 | opts = append(opts, grpc.StatsHandler(sh)) |
| 251 | } |
| 252 | if err := ss.StartServer(opts...); err != nil { |
| 253 | te.t.Fatalf("StubServer.StartServer() failed: %v", err) |
| 254 | } |
| 255 | te.srv = ss.S |
| 256 | te.srvAddr = ss.Address |
| 257 | } |
| 258 | |
| 259 | func (te *test) clientConn(ctx context.Context) *grpc.ClientConn { |
| 260 | if te.cc != nil { |
no test coverage detected