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

Function TestRemoveApplicationWithData

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

Source from the content-addressed store, hash-verified

665}
666
667func TestRemoveApplicationWithData(t *testing.T) {
668 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
669 defer cancel()
670
671 ns, err := docker.NewNamespace("once-removedata-test")
672 require.NoError(t, err)
673 defer ns.Teardown(ctx, true)
674
675 require.NoError(t, ns.EnsureNetwork(ctx))
676 require.NoError(t, ns.Proxy().Boot(ctx, getProxyPorts(t)))
677
678 app := deployApp(t, ctx, ns, docker.ApplicationSettings{
679 Name: "removeapp",
680 Image: "ghcr.io/basecamp/once-campfire:main",
681 Host: "removeapp.localhost",
682 })
683
684 containerPrefix := "once-removedata-test-app-removeapp-"
685 assert.Equal(t, 1, countContainers(t, ctx, containerPrefix))
686
687 require.NoError(t, app.Remove(ctx, true))
688
689 assert.Equal(t, 0, countContainers(t, ctx, containerPrefix))
690
691 _, err = docker.FindVolume(ctx, ns, "removeapp")
692 assert.ErrorIs(t, err, docker.ErrVolumeNotFound)
693}
694
695func TestDeployWithSettings(t *testing.T) {
696 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…