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

Function TestRemoteRuntime_Contract

pkg/runtime/remote_contract_test.go:156–176  ·  view source on GitHub ↗

TestRemoteRuntime_Contract runs the same surface contract LocalRuntime passes against a RemoteRuntime backed by a stub client. Any silent no-op on RemoteRuntime that the contract considers a failure surfaces here as a red test rather than a runtime user complaint.

(t *testing.T)

Source from the content-addressed store, hash-verified

154// no-op on RemoteRuntime that the contract considers a failure surfaces
155// here as a red test rather than a runtime user complaint.
156func TestRemoteRuntime_Contract(t *testing.T) {
157 t.Parallel()
158
159 runRuntimeContract(t, func(t *testing.T) Runtime {
160 t.Helper()
161 client := &stubRemoteClient{
162 cfg: &latest.Config{
163 Agents: latest.Agents{
164 {Name: "test", Description: "test agent"},
165 },
166 },
167 }
168 rt, err := NewRemoteRuntime(client)
169 require.NoError(t, err)
170
171 // Seed a session ID so Steer / FollowUp / Resume / ResumeElicitation
172 // reach the (stubbed) client instead of returning "no active session".
173 rt.sessionID = "test-session"
174 return rt
175 })
176}
177
178// TestRemoteRuntime_SetCurrentAgent_PropagatesClientError pins the
179// fixed behaviour reviewers flagged: when GetAgent fails (network,

Callers

nothing calls this directly

Calls 2

runRuntimeContractFunction · 0.85
NewRemoteRuntimeFunction · 0.85

Tested by

no test coverage detected