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

Function TestRestoreFailsWithFailedPostRestoreHook

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

Source from the content-addressed store, hash-verified

586}
587
588func TestRestoreFailsWithFailedPostRestoreHook(t *testing.T) {
589 ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
590 defer cancel()
591
592 registryURL := startLocalRegistry(t, ctx)
593 hookImage := buildHookImage(t, ctx, registryURL, "restore-hook-fail", "#!/bin/sh\nexit 1")
594
595 backup := buildTestBackup(t, hookImage)
596
597 ns, err := docker.NewNamespace("once-restore-hook-fail-test")
598 require.NoError(t, err)
599 defer ns.Teardown(ctx, true)
600
601 require.NoError(t, ns.EnsureNetwork(ctx))
602 require.NoError(t, ns.Proxy().Boot(ctx, getProxyPorts(t)))
603
604 _, err = ns.Restore(ctx, bytes.NewReader(backup))
605 require.Error(t, err)
606 assert.Contains(t, err.Error(), "post-restore")
607}
608
609func TestRemoveApplication(t *testing.T) {
610 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
RestoreMethod · 0.95
NewNamespaceFunction · 0.92
startLocalRegistryFunction · 0.85
buildHookImageFunction · 0.85
buildTestBackupFunction · 0.85
getProxyPortsFunction · 0.85
BootMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…