Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions internal/temporalcli/commands.activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (c *TemporalActivityStartCommand) run(cctx *CommandContext, args []string)
if err != nil {
return err
}
return printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Type, c.Parent.Namespace, c.TaskQueue)
return printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Parent.Namespace)
}

func (c *TemporalActivityExecuteCommand) run(cctx *CommandContext, args []string) error {
Expand All @@ -66,7 +66,7 @@ func (c *TemporalActivityExecuteCommand) run(cctx *CommandContext, args []string
return err
}
if !cctx.JSONOutput {
if err := printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Type, c.Parent.Namespace, c.TaskQueue); err != nil {
if err := printActivityExecution(cctx, c.ActivityId, handle.GetRunID(), c.Parent.Namespace); err != nil {
cctx.Logger.Error("Failed printing execution info", "error", err)
}
}
Expand Down Expand Up @@ -108,22 +108,18 @@ func startActivity(
return handle, nil
}

func printActivityExecution(cctx *CommandContext, activityID, runID, activityType, namespace, taskQueue string) error {
func printActivityExecution(cctx *CommandContext, activityID, runID, namespace string) error {
if !cctx.JSONOutput {
cctx.Printer.Println(color.MagentaString("Running execution:"))
}
return cctx.Printer.PrintStructured(struct {
ActivityId string `json:"activityId"`
RunId string `json:"runId"`
Type string `json:"type"`
Namespace string `json:"namespace"`
TaskQueue string `json:"taskQueue"`
}{
ActivityId: activityID,
RunId: runID,
Type: activityType,
Namespace: namespace,
TaskQueue: taskQueue,
}, printer.StructuredOptions{})
}

Expand Down
4 changes: 0 additions & 4 deletions internal/temporalcli/commands.activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,7 @@ func (s *SharedServerSuite) TestActivity_Start() {
s.Contains(out, "Running execution:")
s.ContainsOnSameLine(out, "ActivityId", "start-test")
s.Contains(out, "RunId")
s.ContainsOnSameLine(out, "Type", "DevActivity")
s.ContainsOnSameLine(out, "Namespace", "default")
s.ContainsOnSameLine(out, "TaskQueue", s.Worker().Options.TaskQueue)

// JSON
res = s.Execute(
Expand All @@ -561,9 +559,7 @@ func (s *SharedServerSuite) TestActivity_Start() {
s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonOut))
s.Equal("start-test-json", jsonOut["activityId"])
s.NotEmpty(jsonOut["runId"])
s.Equal("DevActivity", jsonOut["type"])
s.Equal("default", jsonOut["namespace"])
s.NotEmpty(jsonOut["taskQueue"])
}

func (s *SharedServerSuite) TestActivity_Start_With_Headers() {
Expand Down