MCPcopy Index your code
hub / github.com/coder/coder / TestScaleTestWorkspaceTraffic_TargetWorkspaces

Function TestScaleTestWorkspaceTraffic_TargetWorkspaces

cli/exp_scaletest_test.go:132–158  ·  view source on GitHub ↗

This test just validates that the CLI command accepts its known arguments.

(t *testing.T)

Source from the content-addressed store, hash-verified

130
131// This test just validates that the CLI command accepts its known arguments.
132func TestScaleTestWorkspaceTraffic_TargetWorkspaces(t *testing.T) {
133 t.Parallel()
134
135 if testutil.RaceEnabled() {
136 t.Skip("Skipping due to race detector")
137 }
138
139 ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
140 defer cancelFunc()
141
142 log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
143 client := coderdtest.New(t, &coderdtest.Options{
144 Logger: &log,
145 })
146 _ = coderdtest.CreateFirstUser(t, client)
147
148 inv, root := clitest.New(t, "exp", "scaletest", "workspace-traffic",
149 "--target-workspaces", "0:0",
150 )
151 clitest.SetupConfig(t, client, root)
152 pty := ptytest.New(t)
153 inv.Stdout = pty.Output()
154 inv.Stderr = pty.Output()
155
156 err := inv.WithContext(ctx).Run()
157 require.ErrorContains(t, err, "invalid target workspaces \"0:0\": start and end cannot be equal")
158}
159
160// This test just validates that the CLI command accepts its known arguments.
161func TestScaleTestCleanup_Template(t *testing.T) {

Callers

nothing calls this directly

Calls 10

RaceEnabledFunction · 0.92
NewFunction · 0.92
CreateFirstUserFunction · 0.92
NewFunction · 0.92
SetupConfigFunction · 0.92
NewFunction · 0.92
SkipMethod · 0.80
WithContextMethod · 0.80
OutputMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected