Skip to content

Commit 29531af

Browse files
test: update e2e workflow --sync assertions to match new output shape (#84)
Commit 94f7f9c (fix: label Orkes-only commands; print workflow output by default with --sync) changed --sync to print only run.Output by default and added --full for the complete WorkflowRun JSON, but workflow.bats test 4 still asserted the old envelope fields ("status", "workflowId"). - Test 4 now checks for the workflow output ("result": "CLI TEST") and asserts "workflowId" is absent (proving we're past the UUID-only path and not getting the full envelope). - New test 4b exercises --sync --full to verify the complete-envelope path still works. This was the only failing test on main's E2E Tests run.
1 parent 94f7f9c commit 29531af

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

test/e2e/workflow.bats

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,32 @@ get_workflow_id() {
4343
}
4444

4545
@test "4. Start workflow execution with --sync --version 1" {
46+
# Default --sync prints only run.Output (JSON); --full prints the complete WorkflowRun.
4647
run bash -c "./conductor workflow start --workflow '$WORKFLOW_NAME_2' --sync --version 1 2>/dev/null"
4748
echo "Output: $output"
4849
[ "$status" -eq 0 ]
4950

50-
# Output should be JSON (workflow execution details), not just a UUID
51-
[[ "$output" == *"\"status\""* ]]
52-
[[ "$output" == *"\"workflowId\""* ]]
53-
[[ "$output" == *"$WORKFLOW_NAME_2"* ]]
51+
# Output should be the workflow's output JSON — not a UUID, not the full WorkflowRun envelope.
52+
[[ "$output" == *"\"result\""* ]]
53+
[[ "$output" == *"CLI TEST"* ]]
54+
[[ "$output" != *"\"workflowId\""* ]]
5455

5556
# Should NOT be just a single line UUID
5657
line_count=$(echo "$output" | wc -l | tr -d ' ')
5758
[ "$line_count" -gt 1 ]
5859
}
5960

61+
@test "4b. Start workflow execution with --sync --full prints complete WorkflowRun" {
62+
run bash -c "./conductor workflow start --workflow '$WORKFLOW_NAME_2' --sync --full --version 1 2>/dev/null"
63+
echo "Output: $output"
64+
[ "$status" -eq 0 ]
65+
66+
# --full returns the complete WorkflowRun JSON (status, workflowId, etc.)
67+
[[ "$output" == *"\"status\""* ]]
68+
[[ "$output" == *"\"workflowId\""* ]]
69+
[[ "$output" == *"$WORKFLOW_NAME_2"* ]]
70+
}
71+
6072
@test "5. Cleanup - delete workflow definition for sync test" {
6173
run bash -c "./conductor workflow delete '$WORKFLOW_NAME_2' 1 -y 2>/dev/null"
6274
echo "Output: $output"

0 commit comments

Comments
 (0)