WorkspaceBuild generates a workspace build for the provided workspace. Pass a database.Workspace{} with a nil ID to also generate a new workspace. Omitting the template ID on a workspace will also generate a new template with a template version.
(t testing.TB, db database.Store, ws database.WorkspaceTable)
| 124 | // Omitting the template ID on a workspace will also generate a new template |
| 125 | // with a template version. |
| 126 | func WorkspaceBuild(t testing.TB, db database.Store, ws database.WorkspaceTable) WorkspaceBuildBuilder { |
| 127 | return WorkspaceBuildBuilder{ |
| 128 | t: t, db: db, ws: ws, |
| 129 | logger: slogtest.Make(t, &slogtest.Options{}).Named("dbfake").Leveled(slog.LevelDebug), |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | func (b WorkspaceBuildBuilder) Pubsub(ps pubsub.Pubsub) WorkspaceBuildBuilder { |
| 134 | // nolint: revive // returns modified struct |