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)
| 204 | // startAndGetID is a helper that starts a process and returns |
| 205 | // the process ID. |
| 206 | func 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 | |
| 220 | func TestStartProcess(t *testing.T) { |
| 221 | t.Parallel() |
no test coverage detected