-
Notifications
You must be signed in to change notification settings - Fork 34
feat: clarify command output when async flag is set #1329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
386dc10
e0ca2d7
9029102
1f89580
b04519a
f0ba899
3667ecd
4248524
d02de70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -194,7 +194,7 @@ func TestOutputResult(t *testing.T) { | |
| { | ||
| name: "empty input", | ||
| args: args{ | ||
| model: &inputModel{}, | ||
| model: fixtureInputModel(), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you change that? 😅
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So that model.GlobalFlagModel.Async is not nil. It would panic because of "if model.Async" in internal/cmd/git/instance/create/create.go:160
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it was the pattern for tests, where the GlobalFlagModel pointer should not be nil. |
||
| resp: &git.Instance{}, | ||
| }, | ||
| wantErr: false, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -382,6 +382,7 @@ func TestBuildRequest(t *testing.T) { | |
| func TestOutputResult(t *testing.T) { | ||
| type args struct { | ||
| outputFormat string | ||
| async bool | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would prefer to have it like this in all the other tests so that you don't just hardcode it to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point! I agree and will update the tests to be consistent. |
||
| projectLabel string | ||
| server *iaas.Server | ||
| } | ||
|
|
@@ -407,7 +408,7 @@ func TestOutputResult(t *testing.T) { | |
| p.Cmd = NewCmd(&types.CmdParams{Printer: p}) | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| if err := outputResult(p, tt.args.outputFormat, tt.args.projectLabel, tt.args.server); (err != nil) != tt.wantErr { | ||
| if err := outputResult(p, tt.args.outputFormat, tt.args.async, tt.args.projectLabel, tt.args.server); (err != nil) != tt.wantErr { | ||
| t.Errorf("outputResult() error = %v, wantErr %v", err, tt.wantErr) | ||
| } | ||
| }) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your fault - But this switch case in all these KMS commands isn't neccessary. Maybe you can refactor it to also use
p.OutputResult? 😅stackit-cli/internal/pkg/print/print.go
Lines 267 to 293 in 0f02251
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to do that.