Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
joanlopez committed Aug 26, 2024
1 parent 901ab78 commit 4bbc72f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (c *cmdCloud) flagSet() *pflag.FlagSet {
flags.BoolVar(&c.uploadOnly, "upload-only", c.uploadOnly,
"only upload the test to the cloud without actually starting a test run")
if err := flags.MarkDeprecated("upload-only", "use \"k6 cloud upload\" instead"); err != nil {
panic(err)
panic(err) // Should never happen
}

return flags
Expand Down
11 changes: 6 additions & 5 deletions cmd/cloud_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ func getCmdCloudUpload(cloudCmd *cmdCloud) *cobra.Command {

// uploadCloudCommand represents the 'cloud upload' command
exampleText := getExampleText(cloudCmd.gs, `
# Upload the test to the Grafana Cloud k6 without actually starting a test run
# Upload the test script and its resources to the Grafana Cloud k6 without actually starting a test run
$ {{.}} cloud upload script.js`[1:])

uploadCloudCommand := &cobra.Command{
Use: cloudUploadCommandName,
Short: "Upload the test to the Grafana Cloud k6",
Long: `Upload the test to the Grafana Cloud k6.
Short: "Upload the test script to the Grafana Cloud k6",
Long: `Upload the test script and its resources to the Grafana Cloud k6.
This will upload the test to the Grafana Cloud k6 service. Using this command requires to be authenticated
against the Grafana Cloud k6. Use the "k6 cloud login" command to authenticate.
This will upload the test script and its resources to the Grafana Cloud k6 service.
Using this command requires to be authenticated against the Grafana Cloud k6.
Use the "k6 cloud login" command to authenticate.
`,
Example: exampleText,
Args: exactArgsWithMsg(1, "arg should either be \"-\", if reading script from stdin, or a path to a script file"),
Expand Down
2 changes: 1 addition & 1 deletion cmd/tests/cmd_cloud_upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestK6CloudUpload(t *testing.T) {

ts := getSimpleCloudTestState(t, nil, setupK6CloudUploadCmd, nil, nil, nil)
delete(ts.Env, "K6_CLOUD_TOKEN")
ts.ExpectedExitCode = -1 // TODO: use a more specific exit code?
ts.ExpectedExitCode = -1
cmd.ExecuteWithGlobalState(ts.GlobalState)

stdout := ts.Stdout.String()
Expand Down

0 comments on commit 4bbc72f

Please sign in to comment.