-
Notifications
You must be signed in to change notification settings - Fork 127
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
fix: better error messages and failed execution info #877
Changes from all commits
fd4bb3c
cba677e
ae10783
300b03a
5251120
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ import ( | |
"text/template" | ||
|
||
"github.com/kubeshop/testkube/pkg/api/v1/testkube" | ||
"github.com/kubeshop/testkube/pkg/ui" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
|
@@ -77,14 +78,14 @@ func (r ExecutionRawRenderer) Watch(execution testkube.Execution, writer io.Writ | |
return err | ||
} | ||
|
||
// TODO fix this - introduce some common data interface for rendering such objects | ||
// renderers need to be simplified and render Execution should be in one place (not many as now) | ||
// - move all logic from execution, start, watch here to show final execution | ||
func (r ExecutionRawRenderer) renderDetails(execution testkube.Execution, writer io.Writer) error { | ||
_, err := fmt.Fprintf(writer, "Name: %s, Status: %s, Duration: %s\n", | ||
execution.Name, | ||
*execution.ExecutionResult.Status, | ||
execution.CalculateDuration(), | ||
) | ||
|
||
return err | ||
ui.Writer = writer | ||
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. Is this thread safe? Write is a global var 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. No, added comment to rewrite whole ui, to be able to get new instance with writer passed / I know this sucks ;) as this global is good for simple use cases - we can rethink this whole solution on some meeting with team 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. |
||
uiPrintStatus(execution) | ||
uiShellGetExecution(execution.Id) | ||
return nil | ||
} | ||
|
||
func GetExecutionRenderer(cmd *cobra.Command) ExecutionRenderer { | ||
|
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.
this
ui
is ugly I know ;)