Skip to content

Commit

Permalink
Test that bad update name yields an error with update start
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Aug 29, 2024
1 parent f828326 commit f81dbf6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions temporalcli/commands.workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@ func (t workflowUpdateTest) testWorkflowUpdateHelper() {
res = t.s.Execute("workflow", "update", "start", "--wait-for-stage", "accepted", "--address", t.s.Address(), "-w", "nonexistent-wf-id", "--name", updateName, "-i", strconv.Itoa(input))
t.s.ErrorContains(res.Err, "unable to update workflow")

// TODO: wrong update name is not currently an error when using `update start` (?!)
// update rejected, wrong update name
res = t.s.Execute("workflow", "update", "start", "--wait-for-stage", "accepted", "--address", t.s.Address(), "-w", run.GetID(), "--name", "nonexistent-update-name", "-i", strconv.Itoa(input))
t.s.ErrorContains(res.Err, "unable to update workflow")
} else {
// update rejected, name not supplied
res = t.s.Execute("workflow", "update", "execute", "--address", t.s.Address(), "-w", run.GetID(), "-i", strconv.Itoa(input))
Expand All @@ -484,7 +486,6 @@ func (t workflowUpdateTest) testWorkflowUpdateHelper() {
t.s.ErrorContains(res.Err, "unable to update workflow")

// update rejected, wrong update name
// This is not currently an error when using `update start`: the SDK accepts the update before checking whether a handler exists.
res = t.s.Execute("workflow", "update", "execute", "--address", t.s.Address(), "-w", run.GetID(), "--name", "nonexistent-update-name", "-i", strconv.Itoa(input))
t.s.ErrorContains(res.Err, "unable to update workflow")
}
Expand Down

0 comments on commit f81dbf6

Please sign in to comment.