Skip to content

Commit 54bb728

Browse files
committed
fix(client-go): align output to python CLI
Deis' integration tests have specific expectations of what text is printed for each command or error. This aligns the new Go CLI output to the old Python CLI output, at least enough to satisfy the tests.
1 parent 136f371 commit 54bb728

4 files changed

Lines changed: 19 additions & 3 deletions

File tree

client-go/cmd/apps.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ func AppInfo(appID string) error {
102102
fmt.Println("owner: ", app.Owner)
103103
fmt.Println("id: ", app.ID)
104104

105+
fmt.Println()
106+
// print the app processes
107+
if err = PsList(app.ID, defaultLimit); err != nil {
108+
return err
109+
}
110+
111+
fmt.Println()
112+
// print the app domains
113+
if err = DomainsList(app.ID, defaultLimit); err != nil {
114+
return err
115+
}
116+
117+
fmt.Println()
118+
105119
return nil
106120
}
107121

client-go/cmd/auth.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func Register(controller string, username string, password string, email string,
7272
c.Token = ""
7373

7474
if err != nil {
75+
fmt.Print("Registration failed: ")
7576
return err
7677
}
7778

@@ -186,6 +187,7 @@ func Passwd(username string, password string, newPassword string) error {
186187
err = auth.Passwd(c, username, password, newPassword)
187188

188189
if err != nil {
190+
fmt.Print("Password change failed: ")
189191
return err
190192
}
191193

client-go/cmd/limits.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func parseLimits(limits []string) map[string]interface{} {
145145
}
146146

147147
func parseLimit(limit string) (string, string, error) {
148-
regex := regexp.MustCompile("^([A-z]+)=([0-9]+[BKMG]{1}|[0-9]{1,4})$")
148+
regex := regexp.MustCompile("^([A-z]+)=([0-9]+[bkmgBKMG]{1,2}|[0-9]{1,4})$")
149149

150150
if !regex.MatchString(limit) {
151151
return "", "", fmt.Errorf(`%s doesn't fit format type=#unit or type=#

tests/auth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ func authCancel(t *testing.T, params *utils.DeisTestConfig) {
4949
admin := utils.GetGlobalConfig()
5050
utils.Execute(t, authLoginCmd, admin, false, "")
5151
utils.Execute(t, authCancelAdminCmd, user, false, "Account cancelled")
52-
// Make sure the admin is still logged in
53-
utils.CheckList(t, authWhoamiCmd, admin, admin.UserName, false)
52+
// Make sure the user's config was purged after auth:cancel
53+
utils.Execute(t, authWhoamiCmd, admin, true, "Error: Not logged in")
5454
}
5555

5656
func authLoginTest(t *testing.T, params *utils.DeisTestConfig) {

0 commit comments

Comments
 (0)