Skip to content

Commit 28d80ad

Browse files
committed
Make sure unit tests have deployment ids
1 parent d4a8b81 commit 28d80ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/coderdtest/coderdtest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
206206
options.Database = dbauthz.New(options.Database, options.Authorizer, slogtest.Make(t, nil).Leveled(slog.LevelDebug))
207207
}
208208

209+
// Some routes expect a deployment ID
210+
err := options.Database.InsertDeploymentID(dbauthz.AsSystemRestricted(context.Background()), uuid.NewString())
211+
require.NoError(t, err, "insert a deployment id")
212+
209213
if options.DeploymentValues == nil {
210214
options.DeploymentValues = DeploymentValues(t)
211215
}

0 commit comments

Comments
 (0)