MCPcopy Index your code
hub / github.com/coder/coder / startAndGetID

Function startAndGetID

agent/agentproc/api_test.go:206–218  ·  view source on GitHub ↗

startAndGetID is a helper that starts a process and returns the process ID.

(t *testing.T, handler http.Handler, req workspacesdk.StartProcessRequest, headers ...http.Header)

Source from the content-addressed store, hash-verified

204// startAndGetID is a helper that starts a process and returns
205// the process ID.
206func startAndGetID(t *testing.T, handler http.Handler, req workspacesdk.StartProcessRequest, headers ...http.Header) string {
207 t.Helper()
208
209 w := postStart(t, handler, req, headers...)
210 require.Equal(t, http.StatusOK, w.Code)
211
212 var resp workspacesdk.StartProcessResponse
213 err := json.NewDecoder(w.Body).Decode(&resp)
214 require.NoError(t, err)
215 require.True(t, resp.Started)
216 require.NotEmpty(t, resp.ID)
217 return resp.ID
218}
219
220func TestStartProcess(t *testing.T) {
221 t.Parallel()

Callers 5

TestStartProcessFunction · 0.85
TestListProcessesFunction · 0.85
TestProcessOutputFunction · 0.85
TestSignalProcessFunction · 0.85
TestProcessLifecycleFunction · 0.85

Calls 4

postStartFunction · 0.85
NotEmptyMethod · 0.80
HelperMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected