|
7 | 7 | "testing"
|
8 | 8 |
|
9 | 9 | "github.com/google/uuid"
|
| 10 | + "github.com/sqlc-dev/pqtype" |
10 | 11 | "github.com/stretchr/testify/require"
|
11 | 12 |
|
12 | 13 | "github.com/coder/coder/v2/coderd/database"
|
@@ -68,15 +69,22 @@ func WorkspaceBuild(t testing.TB, db database.Store, ws database.Workspace, seed
|
68 | 69 | WorkspaceBuildID: seed.ID,
|
69 | 70 | })
|
70 | 71 | require.NoError(t, err)
|
71 |
| - job := dbgen.ProvisionerJob(t, db, nil, database.ProvisionerJob{ |
| 72 | + //nolint:gocritic // This is only used by tests. |
| 73 | + job, err := db.InsertProvisionerJob(dbauthz.AsSystemRestricted(context.Background()), database.InsertProvisionerJobParams{ |
72 | 74 | ID: jobID,
|
73 |
| - Input: payload, |
| 75 | + CreatedAt: dbtime.Now(), |
| 76 | + UpdatedAt: dbtime.Now(), |
74 | 77 | OrganizationID: ws.OrganizationID,
|
75 |
| - CompletedAt: sql.NullTime{ |
76 |
| - Time: dbtime.Now(), |
77 |
| - Valid: true, |
78 |
| - }, |
| 78 | + InitiatorID: ws.OwnerID, |
| 79 | + Provisioner: database.ProvisionerTypeEcho, |
| 80 | + StorageMethod: database.ProvisionerStorageMethodFile, |
| 81 | + FileID: uuid.New(), |
| 82 | + Type: database.ProvisionerJobTypeWorkspaceBuild, |
| 83 | + Input: payload, |
| 84 | + Tags: nil, |
| 85 | + TraceMetadata: pqtype.NullRawMessage{}, |
79 | 86 | })
|
| 87 | + require.NoError(t, err, "insert job") |
80 | 88 |
|
81 | 89 | // This intentionally fulfills the minimum requirements of the schema.
|
82 | 90 | // Tests can provide a custom version ID if necessary.
|
|
0 commit comments