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