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

Function TestScaleTestWorkspaceTraffic

cli/exp_scaletest_test.go:69–100  ·  view source on GitHub ↗

This test just validates that the CLI command accepts its known arguments. A more comprehensive test is performed in workspacetraffic/run_test.go

(t *testing.T)

Source from the content-addressed store, hash-verified

67// This test just validates that the CLI command accepts its known arguments.
68// A more comprehensive test is performed in workspacetraffic/run_test.go
69func TestScaleTestWorkspaceTraffic(t *testing.T) {
70 t.Parallel()
71
72 if testutil.RaceEnabled() {
73 t.Skip("Skipping due to race detector")
74 }
75
76 ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
77 defer cancelFunc()
78
79 log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
80 client := coderdtest.New(t, &coderdtest.Options{
81 Logger: &log,
82 })
83 _ = coderdtest.CreateFirstUser(t, client)
84
85 inv, root := clitest.New(t, "exp", "scaletest", "workspace-traffic",
86 "--timeout", "1s",
87 "--bytes-per-tick", "1024",
88 "--tick-interval", "100ms",
89 "--scaletest-prometheus-address", "127.0.0.1:0",
90 "--scaletest-prometheus-wait", "0s",
91 "--ssh",
92 )
93 clitest.SetupConfig(t, client, root)
94 pty := ptytest.New(t)
95 inv.Stdout = pty.Output()
96 inv.Stderr = pty.Output()
97
98 err := inv.WithContext(ctx).Run()
99 require.ErrorContains(t, err, "no scaletest workspaces exist")
100}
101
102// This test just validates that the CLI command accepts its known arguments.
103func TestScaleTestWorkspaceTraffic_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