MCPcopy Index your code
hub / github.com/docker/docker-agent / TestShellTool_RunBackgroundJob

Function TestShellTool_RunBackgroundJob

pkg/tools/builtin/shell/shell_test.go:204–216  ·  view source on GitHub ↗

Minimal tests for background job features

(t *testing.T)

Source from the content-addressed store, hash-verified

202
203// Minimal tests for background job features
204func TestShellTool_RunBackgroundJob(t *testing.T) {
205 t.Parallel()
206 tool := New(nil, &config.RuntimeConfig{Config: config.Config{WorkingDir: t.TempDir()}})
207 err := tool.Start(t.Context())
208 require.NoError(t, err)
209 t.Cleanup(func() {
210 _ = tool.Stop(t.Context())
211 })
212
213 result, err := tool.handler.RunShellBackground(t.Context(), RunShellBackgroundArgs{Cmd: "echo test"})
214 require.NoError(t, err)
215 assert.Contains(t, result.Output, "Background job started with ID:")
216}
217
218func TestShellTool_ListBackgroundJobs(t *testing.T) {
219 t.Parallel()

Callers

nothing calls this directly

Calls 6

ContextMethod · 0.80
RunShellBackgroundMethod · 0.80
NewFunction · 0.70
StartMethod · 0.65
CleanupMethod · 0.65
StopMethod · 0.65

Tested by

no test coverage detected