Test that the RPC invoker doesn't throw an error when requesting a full rebuild
(t *testing.T)
| 199 | |
| 200 | // Test that the RPC invoker doesn't throw an error when requesting a full rebuild |
| 201 | func TestRebuildContainerFull(t *testing.T) { |
| 202 | resp := codespace.RebuildContainerResponse{ |
| 203 | RebuildContainer: true, |
| 204 | } |
| 205 | |
| 206 | server := newMockServer() |
| 207 | server.RebuildContainerAsyncFunc = func(context.Context, *codespace.RebuildContainerRequest) (*codespace.RebuildContainerResponse, error) { |
| 208 | return &resp, nil |
| 209 | } |
| 210 | |
| 211 | invoker, stop, err := createTestInvoker(t, server) |
| 212 | if err != nil { |
| 213 | t.Fatalf("error connecting to internal server: %v", err) |
| 214 | } |
| 215 | defer stop() |
| 216 | |
| 217 | err = invoker.RebuildContainer(context.Background(), true) |
| 218 | if err != nil { |
| 219 | t.Fatalf("expected %v, got %v", nil, err) |
| 220 | } |
| 221 | |
| 222 | verifyNotifyCodespaceOfClientActivity(t, server) |
| 223 | } |
| 224 | |
| 225 | // Test that the RPC invoker throws an error when the rebuild fails |
| 226 | func TestRebuildContainerFailure(t *testing.T) { |
nothing calls this directly
no test coverage detected