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

Function TestScaleTestWorkspaceTraffic_Template

cli/exp_scaletest_test.go:103–129  ·  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

101
102// This test just validates that the CLI command accepts its known arguments.
103func TestScaleTestWorkspaceTraffic_Template(t *testing.T) {
104 t.Parallel()
105
106 if testutil.RaceEnabled() {
107 t.Skip("Skipping due to race detector")
108 }
109
110 ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium)
111 defer cancelFunc()
112
113 log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
114 client := coderdtest.New(t, &coderdtest.Options{
115 Logger: &log,
116 })
117 _ = coderdtest.CreateFirstUser(t, client)
118
119 inv, root := clitest.New(t, "exp", "scaletest", "workspace-traffic",
120 "--template", "doesnotexist",
121 )
122 clitest.SetupConfig(t, client, root)
123 pty := ptytest.New(t)
124 inv.Stdout = pty.Output()
125 inv.Stderr = pty.Output()
126
127 err := inv.WithContext(ctx).Run()
128 require.ErrorContains(t, err, "could not find template \"doesnotexist\" in any organization")
129}
130
131// This test just validates that the CLI command accepts its known arguments.
132func TestScaleTestWorkspaceTraffic_TargetWorkspaces(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