(t *testing.T)
| 607 | } |
| 608 | |
| 609 | func TestRemoveApplication(t *testing.T) { |
| 610 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) |
| 611 | defer cancel() |
| 612 | |
| 613 | ns, err := docker.NewNamespace("once-remove-test") |
| 614 | require.NoError(t, err) |
| 615 | defer ns.Teardown(ctx, true) |
| 616 | |
| 617 | require.NoError(t, ns.EnsureNetwork(ctx)) |
| 618 | require.NoError(t, ns.Proxy().Boot(ctx, getProxyPorts(t))) |
| 619 | |
| 620 | app := deployApp(t, ctx, ns, docker.ApplicationSettings{ |
| 621 | Name: "removeapp", |
| 622 | Image: "ghcr.io/basecamp/once-campfire:main", |
| 623 | Host: "removeapp.localhost", |
| 624 | }) |
| 625 | |
| 626 | containerPrefix := "once-remove-test-app-removeapp-" |
| 627 | assert.Equal(t, 1, countContainers(t, ctx, containerPrefix)) |
| 628 | |
| 629 | require.NoError(t, app.Remove(ctx, false)) |
| 630 | |
| 631 | assert.Equal(t, 0, countContainers(t, ctx, containerPrefix)) |
| 632 | |
| 633 | _, err = docker.FindVolume(ctx, ns, "removeapp") |
| 634 | assert.NoError(t, err, "volume should still exist") |
| 635 | } |
| 636 | |
| 637 | func TestVerifyHTTPOrRemoveAllowsRedeployWithSameHost(t *testing.T) { |
| 638 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) |
nothing calls this directly
no test coverage detected
searching dependent graphs…