Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit99e103e

Browse files
authored
feat(coderd/coderdtest): allow mutating deployment values (#14414)
1 parent4cc26be commit99e103e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

‎coderd/coderdtest/coderdtest.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,10 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
268268
ifoptions.DeploymentValues==nil {
269269
options.DeploymentValues=DeploymentValues(t)
270270
}
271-
// This value is not safe to run in parallel. Force it to be false.
272-
options.DeploymentValues.DisableOwnerWorkspaceExec=false
271+
// This value is not safe to run in parallel.
272+
ifoptions.DeploymentValues.DisableOwnerWorkspaceExec {
273+
t.Logf("WARNING: DisableOwnerWorkspaceExec is set, this is not safe in parallel tests!")
274+
}
273275

274276
// If no ratelimits are set, disable all rate limiting for tests.
275277
ifoptions.APIRateLimit==0 {
@@ -1385,10 +1387,13 @@ func SDKError(t testing.TB, err error) *codersdk.Error {
13851387
returncerr
13861388
}
13871389

1388-
funcDeploymentValues(t testing.TB)*codersdk.DeploymentValues {
1389-
varcfg codersdk.DeploymentValues
1390+
funcDeploymentValues(t testing.TB,mut...func(*codersdk.DeploymentValues))*codersdk.DeploymentValues {
1391+
cfg:=&codersdk.DeploymentValues{}
13901392
opts:=cfg.Options()
13911393
err:=opts.SetDefaults()
13921394
require.NoError(t,err)
1393-
return&cfg
1395+
for_,fn:=rangemut {
1396+
fn(cfg)
1397+
}
1398+
returncfg
13941399
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp