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

* refactor(cli): mv scaletest exp/scaletest

* make gen
This commit is contained in:
Cian Johnston
2023-07-07 09:10:14 +01:00
committed by GitHub
parent ccea595b39
commit 435c67ab75
13 changed files with 24 additions and 531 deletions
+18
View File
@@ -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
}
+1 -1
View File
@@ -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",
@@ -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",
@@ -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",
+1 -1
View File
@@ -95,7 +95,6 @@ func (r *RootCmd) Core() []*clibase.Cmd {
r.list(),
r.ping(),
r.rename(),
r.scaletest(),
r.schedules(),
r.show(),
r.speedtest(),
@@ -111,6 +110,7 @@ func (r *RootCmd) Core() []*clibase.Cmd {
r.netcheck(),
r.vscodeSSH(),
r.workspaceAgent(),
r.expCmd(),
}
}
-1
View File
@@ -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