Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 17f692a

Browse files
authored
fix(scaletest): correctly validate configs using SessionToken (#7111)
1 parent f517724 commit 17f692a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scaletest/createworkspaces/config.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ func (c UserConfig) Validate() error {
2626
if c.OrganizationID == uuid.Nil {
2727
return xerrors.New("organization_id must not be a nil UUID")
2828
}
29-
if c.Username == "" {
30-
return xerrors.New("username must be set")
31-
}
32-
if c.Email == "" {
33-
return xerrors.New("email must be set")
29+
if c.SessionToken == "" {
30+
if c.Username == "" {
31+
return xerrors.New("username must be set")
32+
}
33+
if c.Email == "" {
34+
return xerrors.New("email must be set")
35+
}
3436
}
3537

3638
return nil

scaletest/createworkspaces/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
7272

7373
_, _ = fmt.Fprintln(logs, "Creating user:")
7474

75-
user, err := r.client.CreateUser(ctx, codersdk.CreateUserRequest{
75+
user, err = r.client.CreateUser(ctx, codersdk.CreateUserRequest{
7676
OrganizationID: r.cfg.User.OrganizationID,
7777
Username: r.cfg.User.Username,
7878
Email: r.cfg.User.Email,

0 commit comments

Comments
 (0)