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)
| 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 |
| 69 | func 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. |
| 103 | func TestScaleTestWorkspaceTraffic_Template(t *testing.T) { |
nothing calls this directly
no test coverage detected