MCPcopy
hub / github.com/basecamp/once / TestRemoveApplication

Function TestRemoveApplication

integration/docker_test.go:609–635  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

607}
608
609func 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
637func TestVerifyHTTPOrRemoveAllowsRedeployWithSameHost(t *testing.T) {
638 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)

Callers

nothing calls this directly

Calls 11

TeardownMethod · 0.95
EnsureNetworkMethod · 0.95
ProxyMethod · 0.95
NewNamespaceFunction · 0.92
FindVolumeFunction · 0.92
getProxyPortsFunction · 0.85
deployAppFunction · 0.85
countContainersFunction · 0.85
BootMethod · 0.80
EqualMethod · 0.80
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…