(t *testing.T, h integrationHarness, name string, workspace string)
| 347 | } |
| 348 | |
| 349 | func createIntegrationSession(t *testing.T, h integrationHarness, name string, workspace string) SessionRecord { |
| 350 | t.Helper() |
| 351 | |
| 352 | out := mustExecuteRoot( |
| 353 | t, |
| 354 | h.deps, |
| 355 | "session", |
| 356 | "new", |
| 357 | "--agent", |
| 358 | "coder", |
| 359 | "--name", |
| 360 | name, |
| 361 | "--workspace", |
| 362 | workspace, |
| 363 | "-o", |
| 364 | "json", |
| 365 | ) |
| 366 | var created SessionRecord |
| 367 | if err := json.Unmarshal([]byte(out), &created); err != nil { |
| 368 | t.Fatalf("json.Unmarshal(session new) error = %v", err) |
| 369 | } |
| 370 | if created.ID == "" || created.State != session.StateActive { |
| 371 | t.Fatalf("created session = %#v, want active session with id", created) |
| 372 | } |
| 373 | return created |
| 374 | } |
| 375 | |
| 376 | func assertPathExists(t *testing.T, path string) { |
| 377 | t.Helper() |
no test coverage detected