-
Notifications
You must be signed in to change notification settings - Fork 42
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
Supported flattened event detail view on workflow show/execute #615
Changes from all commits
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 |
---|---|---|
|
@@ -251,7 +251,7 @@ func (s *SharedServerSuite) TestWorkflow_Show_Follow() { | |
s.testWorkflowShowFollow(false) | ||
} | ||
|
||
func (s *SharedServerSuite) testWorkflowShowFollow(eventDetails bool) { | ||
func (s *SharedServerSuite) testWorkflowShowFollow(detailed bool) { | ||
s.Worker().OnDevWorkflow(func(ctx workflow.Context, a any) (any, error) { | ||
sigs := 0 | ||
for { | ||
|
@@ -280,8 +280,8 @@ func (s *SharedServerSuite) testWorkflowShowFollow(eventDetails bool) { | |
"--address", s.Address(), | ||
"-w", run.GetID(), | ||
"--follow"} | ||
if eventDetails { | ||
args = append(args, "--event-details") | ||
if detailed { | ||
args = append(args, "--detailed") | ||
} | ||
res := s.Execute(args...) | ||
outputCh <- res | ||
|
@@ -296,18 +296,24 @@ func (s *SharedServerSuite) testWorkflowShowFollow(eventDetails bool) { | |
res := <-outputCh | ||
s.NoError(res.Err) | ||
output := res.Stdout.String() | ||
if eventDetails { | ||
s.Contains(output, "my-signal") | ||
} | ||
// Confirm result present | ||
s.ContainsOnSameLine(output, "Result", `"hi!"`) | ||
s.NoError(run.Get(s.Context, nil)) | ||
|
||
// Detailed uses sections, non-detailed uses table | ||
if detailed { | ||
s.Contains(output, "input[0]: ignored") | ||
s.Contains(output, "signalName: my-signal") | ||
} else { | ||
s.Contains(output, "WorkflowExecutionSignaled") | ||
} | ||
Comment on lines
+307
to
+309
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. This would show up in both output kinds, right? Non-detailed on the line, and detailed in the section header. 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. Yes, but before this the test tested nothing about non-detailed event output, so I just thought I'd add it in an 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. Yeah I'd just assert it either way |
||
} | ||
|
||
func (s *SharedServerSuite) TestWorkflow_Show_NoFollow() { | ||
s.testWorkflowShowNoFollow(true) | ||
s.testWorkflowShowNoFollow(false) | ||
} | ||
func (s *SharedServerSuite) testWorkflowShowNoFollow(eventDetails bool) { | ||
func (s *SharedServerSuite) testWorkflowShowNoFollow(detailed bool) { | ||
s.Worker().OnDevWorkflow(func(ctx workflow.Context, a any) (any, error) { | ||
sigs := 0 | ||
for { | ||
|
@@ -332,8 +338,8 @@ func (s *SharedServerSuite) testWorkflowShowNoFollow(eventDetails bool) { | |
args := []string{"workflow", "show", | ||
"--address", s.Address(), | ||
"-w", run.GetID()} | ||
if eventDetails { | ||
args = append(args, "--event-details") | ||
if detailed { | ||
args = append(args, "--detailed") | ||
} | ||
res := s.Execute(args...) | ||
s.NoError(res.Err) | ||
|
@@ -349,7 +355,7 @@ func (s *SharedServerSuite) testWorkflowShowNoFollow(eventDetails bool) { | |
res = s.Execute(args...) | ||
s.NoError(res.Err) | ||
out = res.Stdout.String() | ||
if eventDetails { | ||
if detailed { | ||
s.Contains(out, "my-signal") | ||
} | ||
s.ContainsOnSameLine(out, "Result", `"hi!"`) | ||
|
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.
For arrays, will sorting do alphabetical sort as opposed to numerical "7" > "10"
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.
It might, good catch! I will fix this and add a test for it.