Skip to content

Commit

Permalink
Reference 'k6 cloud' instead of 'Load Impact' in docs and errors (gra…
Browse files Browse the repository at this point in the history
…fana#2942)


Co-authored-by: Ivan Mirić <[email protected]>
  • Loading branch information
mstoykov and Ivan Mirić authored Mar 7, 2023
1 parent 98ee8e4 commit 37cd20b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions cloudapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
k6IdempotencyKeyHeader = "k6-Idempotency-Key"
)

// Client handles communication with Load Impact cloud API.
// Client handles communication with the k6 Cloud API.
type Client struct {
client *http.Client
token string
Expand Down Expand Up @@ -160,7 +160,7 @@ func (c *Client) do(req *http.Request, v interface{}, attempt int) (retry bool,

func checkResponse(r *http.Response) error {
if r == nil {
return ErrUnknown
return errUnknown
}

if c := r.StatusCode; c >= 200 && c <= 299 {
Expand All @@ -177,10 +177,10 @@ func checkResponse(r *http.Response) error {
}
if err := json.Unmarshal(data, &payload); err != nil {
if r.StatusCode == http.StatusUnauthorized {
return ErrNotAuthenticated
return errNotAuthenticated
}
if r.StatusCode == http.StatusForbidden {
return ErrNotAuthorized
return errNotAuthorized
}
return fmt.Errorf(
"unexpected HTTP error from %s: %d %s",
Expand Down Expand Up @@ -220,6 +220,7 @@ func shouldAddIdempotencyKey(req *http.Request) bool {

// randomStrHex returns a hex string which can be used
// for session token id or idempotency key.
//
//nolint:gosec
func randomStrHex() string {
// 16 hex characters
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"go.k6.io/k6/lib/types"
)

// Config holds all the necessary data and options for sending metrics to the Load Impact cloud.
// Config holds all the necessary data and options for sending metrics to the k6 Cloud.
//
//nolint:lll
type Config struct {
Expand Down
6 changes: 3 additions & 3 deletions cloudapi/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
)

var (
ErrNotAuthorized = errors.New("Not allowed to upload result to Load Impact cloud")
ErrNotAuthenticated = errors.New("Failed to authenticate with Load Impact cloud")
ErrUnknown = errors.New("An error occurred talking to Load Impact cloud")
errNotAuthorized = errors.New("not allowed to upload result to k6 Cloud")
errNotAuthenticated = errors.New("failed to authenticate with k6 Cloud")
errUnknown = errors.New("an error occurred communicating with k6 Cloud")
)

// ErrorResponse represents an error cause by talking to the API
Expand Down
4 changes: 2 additions & 2 deletions cmd/login_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func getCmdLoginCloud(gs *state.GlobalState) *cobra.Command {

loginCloudCommand := &cobra.Command{
Use: "cloud",
Short: "Authenticate with Load Impact",
Long: `Authenticate with Load Impact.
Short: "Authenticate with k6 Cloud",
Long: `Authenticate with k6 Cloud",
This will set the default token used when just "k6 run -o cloud" is passed.`,
Example: exampleText,
Expand Down
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ func getCmdRun(gs *state.GlobalState) *cobra.Command {

runCmd := &cobra.Command{
Use: "run",
Short: "Start a load test",
Long: `Start a load test.
Short: "Start a test",
Long: `Start a test.
This also exposes a REST API to interact with it. Various k6 subcommands offer
a commandline interface for interacting with it.`,
Expand Down
4 changes: 2 additions & 2 deletions output/cloud/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"go.k6.io/k6/metrics"
)

// TestName is the default Load Impact Cloud test name
// TestName is the default k6 Cloud test name
const TestName = "k6 test"

// Output sends result data to the Load Impact cloud service.
// Output sends result data to the k6 Cloud service.
type Output struct {
config cloudapi.Config
referenceID string
Expand Down

0 comments on commit 37cd20b

Please sign in to comment.