( t *testing.T, clock quartz.Clock, db database.Store, ps pubsub.Pubsub, orgID uuid.UUID, ownerID uuid.UUID, templateID uuid.UUID, templateVersionID uuid.UUID, presetID uuid.UUID, )
| 394 | } |
| 395 | |
| 396 | func setupTestDBWorkspace( |
| 397 | t *testing.T, |
| 398 | clock quartz.Clock, |
| 399 | db database.Store, |
| 400 | ps pubsub.Pubsub, |
| 401 | orgID uuid.UUID, |
| 402 | ownerID uuid.UUID, |
| 403 | templateID uuid.UUID, |
| 404 | templateVersionID uuid.UUID, |
| 405 | presetID uuid.UUID, |
| 406 | ) database.WorkspaceTable { |
| 407 | t.Helper() |
| 408 | |
| 409 | workspace := dbgen.Workspace(t, db, database.WorkspaceTable{ |
| 410 | TemplateID: templateID, |
| 411 | OrganizationID: orgID, |
| 412 | OwnerID: ownerID, |
| 413 | Deleted: false, |
| 414 | CreatedAt: time.Now().Add(-time.Hour * 2), |
| 415 | }) |
| 416 | job := dbgen.ProvisionerJob(t, db, ps, database.ProvisionerJob{ |
| 417 | InitiatorID: ownerID, |
| 418 | CreatedAt: time.Now().Add(-time.Hour * 2), |
| 419 | StartedAt: sql.NullTime{Time: clock.Now().Add(-time.Hour * 2), Valid: true}, |
| 420 | CompletedAt: sql.NullTime{Time: clock.Now().Add(-time.Hour), Valid: true}, |
| 421 | OrganizationID: orgID, |
| 422 | }) |
| 423 | workspaceBuild := dbgen.WorkspaceBuild(t, db, database.WorkspaceBuild{ |
| 424 | WorkspaceID: workspace.ID, |
| 425 | InitiatorID: ownerID, |
| 426 | TemplateVersionID: templateVersionID, |
| 427 | JobID: job.ID, |
| 428 | TemplateVersionPresetID: uuid.NullUUID{UUID: presetID, Valid: true}, |
| 429 | Transition: database.WorkspaceTransitionStart, |
| 430 | CreatedAt: clock.Now(), |
| 431 | }) |
| 432 | dbgen.WorkspaceBuildParameters(t, db, []database.WorkspaceBuildParameter{ |
| 433 | { |
| 434 | WorkspaceBuildID: workspaceBuild.ID, |
| 435 | Name: "test", |
| 436 | Value: "test", |
| 437 | }, |
| 438 | }) |
| 439 | |
| 440 | return workspace |
| 441 | } |
no test coverage detected