MCPcopy Index your code
hub / github.com/docker/cli / TestPromptExitCode

Function TestPromptExitCode

e2e/global/cli_test.go:81–240  ·  view source on GitHub ↗

Test that the prompt command exits with 0 when the user sends SIGINT/SIGTERM to the process

(t *testing.T)

Source from the content-addressed store, hash-verified

79// Test that the prompt command exits with 0
80// when the user sends SIGINT/SIGTERM to the process
81func TestPromptExitCode(t *testing.T) {
82 t.Parallel()
83
84 ctx, cancel := context.WithCancel(context.Background())
85 t.Cleanup(cancel)
86
87 dir := fixtures.SetupConfigFile(t)
88 t.Cleanup(dir.Remove)
89
90 defaultCmdOpts := []icmd.CmdOp{
91 fixtures.WithConfig(dir.Path()),
92 }
93
94 testCases := []struct {
95 name string
96 run func(t *testing.T) icmd.Cmd
97 }{
98 {
99 name: "volume prune",
100 run: func(t *testing.T) icmd.Cmd {
101 t.Helper()
102 return icmd.Command("docker", "volume", "prune")
103 },
104 },
105 {
106 name: "network prune",
107 run: func(t *testing.T) icmd.Cmd {
108 t.Helper()
109 return icmd.Command("docker", "network", "prune")
110 },
111 },
112 {
113 name: "container prune",
114 run: func(t *testing.T) icmd.Cmd {
115 t.Helper()
116 return icmd.Command("docker", "container", "prune")
117 },
118 },
119 {
120 name: "image prune",
121 run: func(t *testing.T) icmd.Cmd {
122 t.Helper()
123 return icmd.Command("docker", "image", "prune")
124 },
125 },
126 {
127 name: "system prune",
128 run: func(t *testing.T) icmd.Cmd {
129 t.Helper()
130 return icmd.Command("docker", "system", "prune")
131 },
132 },
133 {
134 name: "plugin install",
135 run: func(t *testing.T) icmd.Cmd {
136 t.Helper()
137 t.Skip("flaky test: see https://github.com/docker/cli/issues/6248")
138

Callers

nothing calls this directly

Calls 9

FlushMethod · 0.95
ContainsMethod · 0.80
drainChannelFunction · 0.70
PathMethod · 0.65
ErrMethod · 0.65
StringMethod · 0.65
CommandMethod · 0.45
CloseMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…