Skip to content

refactor(cli)!: move scaletest to exp/scaletest #8339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions cli/exp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cli

import "github.com/coder/coder/cli/clibase"

func (r *RootCmd) expCmd() *clibase.Cmd {
cmd := &clibase.Cmd{
Use: "exp",
Short: "Internal commands for testing and experimentation. These are prone to breaking changes with no notice.",
Handler: func(i *clibase.Invocation) error {
return i.Command.HelpHandler(i)
},
Hidden: true,
Children: []*clibase.Cmd{
r.scaletestCmd(),
},
}
return cmd
}
2 changes: 1 addition & 1 deletion cli/scaletest.go → cli/exp_scaletest.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const scaletestTracerName = "coder_scaletest"

func (r *RootCmd) scaletest() *clibase.Cmd {
func (r *RootCmd) scaletestCmd() *clibase.Cmd {
cmd := &clibase.Cmd{
Use: "scaletest",
Short: "Run a scale test against the Coder API",
Expand Down
4 changes: 2 additions & 2 deletions cli/scaletest_test.go → cli/exp_scaletest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestScaleTestCreateWorkspaces(t *testing.T) {
tDir := t.TempDir()
outputFile := filepath.Join(tDir, "output.json")

inv, root := clitest.New(t, "scaletest", "create-workspaces",
inv, root := clitest.New(t, "exp", "scaletest", "create-workspaces",
"--count", "2",
"--template", "doesnotexist",
"--no-cleanup",
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) {
client := coderdtest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)

inv, root := clitest.New(t, "scaletest", "workspace-traffic",
inv, root := clitest.New(t, "exp", "scaletest", "workspace-traffic",
"--timeout", "1s",
"--bytes-per-tick", "1024",
"--tick-interval", "100ms",
Expand Down
2 changes: 1 addition & 1 deletion cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func (r *RootCmd) Core() []*clibase.Cmd {
r.list(),
r.ping(),
r.rename(),
r.scaletest(),
r.schedules(),
r.show(),
r.speedtest(),
Expand All @@ -111,6 +110,7 @@ func (r *RootCmd) Core() []*clibase.Cmd {
r.netcheck(),
r.vscodeSSH(),
r.workspaceAgent(),
r.expCmd(),
}
}

Expand Down
1 change: 0 additions & 1 deletion cli/testdata/coder_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Coder v0.0.0-devel — A tool for provisioning self-hosted development environme
reset-password Directly connect to the database to reset a user's
password
restart Restart a workspace
scaletest Run a scale test against the Coder API
schedule Schedule automated start and stop times for workspaces
server Start a Coder server
show Display details of a workspace's resources and agents
Expand Down
1 change: 0 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Coder — A tool for provisioning self-hosted development environments with Terr
| [<code>rename</code>](./cli/rename.md) | Rename a workspace |
| [<code>reset-password</code>](./cli/reset-password.md) | Directly connect to the database to reset a user's password |
| [<code>restart</code>](./cli/restart.md) | Restart a workspace |
| [<code>scaletest</code>](./cli/scaletest.md) | Run a scale test against the Coder API |
| [<code>schedule</code>](./cli/schedule.md) | Schedule automated start and stop times for workspaces |
| [<code>server</code>](./cli/server.md) | Start a Coder server |
| [<code>show</code>](./cli/show.md) | Display details of a workspace's resources and agents |
Expand Down
19 changes: 0 additions & 19 deletions docs/cli/scaletest.md

This file was deleted.

49 changes: 0 additions & 49 deletions docs/cli/scaletest_cleanup.md

This file was deleted.

Loading