(t *testing.T, e env)
| 123 | } |
| 124 | |
| 125 | func testCompressServerHasNoSupport(t *testing.T, e env) { |
| 126 | te := newTest(t, e) |
| 127 | te.serverCompression = false |
| 128 | te.clientCompression = false |
| 129 | te.clientNopCompression = true |
| 130 | te.startServer(&testServer{security: e.security}) |
| 131 | defer te.tearDown() |
| 132 | tc := testgrpc.NewTestServiceClient(te.clientConn()) |
| 133 | |
| 134 | const argSize = 271828 |
| 135 | const respSize = 314159 |
| 136 | payload, err := newPayload(testpb.PayloadType_COMPRESSABLE, argSize) |
| 137 | if err != nil { |
| 138 | t.Fatal(err) |
| 139 | } |
| 140 | req := &testpb.SimpleRequest{ |
| 141 | ResponseType: testpb.PayloadType_COMPRESSABLE, |
| 142 | ResponseSize: respSize, |
| 143 | Payload: payload, |
| 144 | } |
| 145 | |
| 146 | ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) |
| 147 | defer cancel() |
| 148 | if _, err := tc.UnaryCall(ctx, req); err == nil || status.Code(err) != codes.Unimplemented { |
| 149 | t.Fatalf("TestService/UnaryCall(_, _) = _, %v, want _, error code %s", err, codes.Unimplemented) |
| 150 | } |
| 151 | // Streaming RPC |
| 152 | stream, err := tc.FullDuplexCall(ctx) |
| 153 | if err != nil { |
| 154 | t.Fatalf("%v.FullDuplexCall(_) = _, %v, want <nil>", tc, err) |
| 155 | } |
| 156 | if _, err := stream.Recv(); err == nil || status.Code(err) != codes.Unimplemented { |
| 157 | t.Fatalf("%v.Recv() = %v, want error code %s", stream, err, codes.Unimplemented) |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | func (s) TestCompressOK(t *testing.T) { |
| 162 | for _, e := range listTestEnv() { |
no test coverage detected