( t *testing.T, db database.Store, userID uuid.UUID, )
| 661 | } |
| 662 | |
| 663 | func seedWorkspaceBinding( |
| 664 | t *testing.T, |
| 665 | db database.Store, |
| 666 | userID uuid.UUID, |
| 667 | ) (database.WorkspaceTable, database.WorkspaceBuild, database.WorkspaceAgent) { |
| 668 | t.Helper() |
| 669 | |
| 670 | org := dbgen.Organization(t, db, database.Organization{}) |
| 671 | tv := dbgen.TemplateVersion(t, db, database.TemplateVersion{ |
| 672 | OrganizationID: org.ID, |
| 673 | CreatedBy: userID, |
| 674 | }) |
| 675 | tpl := dbgen.Template(t, db, database.Template{ |
| 676 | CreatedBy: userID, |
| 677 | OrganizationID: org.ID, |
| 678 | ActiveVersionID: tv.ID, |
| 679 | }) |
| 680 | workspace := dbgen.Workspace(t, db, database.WorkspaceTable{ |
| 681 | TemplateID: tpl.ID, |
| 682 | OwnerID: userID, |
| 683 | OrganizationID: org.ID, |
| 684 | }) |
| 685 | job := dbgen.ProvisionerJob(t, db, nil, database.ProvisionerJob{ |
| 686 | InitiatorID: userID, |
| 687 | OrganizationID: org.ID, |
| 688 | }) |
| 689 | build := dbgen.WorkspaceBuild(t, db, database.WorkspaceBuild{ |
| 690 | TemplateVersionID: tv.ID, |
| 691 | WorkspaceID: workspace.ID, |
| 692 | JobID: job.ID, |
| 693 | }) |
| 694 | resource := dbgen.WorkspaceResource(t, db, database.WorkspaceResource{ |
| 695 | Transition: database.WorkspaceTransitionStart, |
| 696 | JobID: job.ID, |
| 697 | }) |
| 698 | agent := dbgen.WorkspaceAgent(t, db, database.WorkspaceAgent{ResourceID: resource.ID}) |
| 699 | return workspace, build, agent |
| 700 | } |
| 701 | |
| 702 | // findToolByName returns the tool with the given name from the |
| 703 | // slice, or nil if no match is found. |
no test coverage detected