Repository navigation
tests(workflow): add E2E tests for workflow management - #946
Conversation
Cover the HTTP workflow management API (client.workflow) against a real sidecar: scheduling with and without an instance ID, getting state, raising events, pause/resume, terminate, purge, an unknown instance, and the deprecated start/get/raise aliases. Signed-off-by: Subham-u <subhammahapatra004@gmail.com>
|
@devxsubh Is there a particular gap that was missed that this PR is addressing? I already added a broad swath of E2E tests validating the workflow client against the real runtime via Testcontainers. Your description reads:
...and that's not true. All of the workflow E2E tests run against a real sidecar. If the idea is that this PR is addressing gaps in coverage, that's one thing, but that statement makes me question if the tests are duplicates of existing coverage or not. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified in the HTTP workflow management E2E changes, though the first real-sidecar execution remains pending CI.
No open issues 🎉
What changed in this PR
Adds real-sidecar E2E coverage for the HTTP DaprClient.workflow management API, complementing the existing gRPC workflow tests and addressing #498.
Changes:
- Sets up a shared sidecar harness and per-test gRPC worker to execute workflows managed through HTTP.
- Tests scheduling, state retrieval, events, pause/resume, termination, purge, and missing-instance errors.
- Covers deprecated
start,get, andraisealiases.
The suite is included by the existing workflow E2E command. Its first real-sidecar execution is pending CI.
| File | Description |
|---|---|
test/e2e/workflow/management.test.ts |
Adds HTTP workflow management E2E tests, including lifecycle assertions and harness cleanup. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #946 +/- ##
=======================================
Coverage 82.13% 82.13%
=======================================
Files 160 160
Lines 5727 5727
Branches 1188 1188
=======================================
Hits 4704 4704
Misses 855 855
Partials 168 168
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for looking, @WhitWaldo, and you're right that the sentence was too broad. What I meant: the workflow E2E suite drives workflows through |
|
I ran a local analysis and don't see any test duplication, so happy to merge as-is. Thank you very much for spotting the gap and contributing this! |
WhitWaldo
left a comment
There was a problem hiding this comment.
Looks good to me - thank you!
|
@holopin-bot @devxsubh sdk-badge Thank you! Here's a digital badge as a small token of appreciation. |
|
Congratulations @devxsubh, the maintainer of this repository has issued you a badge! Here it is: https://holopin.io/claim/cmwt2y4120007l3082ohgwv55 This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
Description
This adds E2E tests for the HTTP workflow management API (
client.workflow) that #485 added. The workflow e2e suite already coversDaprWorkflowClientover gRPC, but none of it calls the HTTP management API onDaprClient(client.workflow) against a real sidecar.The new file is
test/e2e/workflow/management.test.ts. It follows the setup oftest/e2e/workflow/workflow.test.ts: aWorkflowHarnesssidecar using the shared test images, aWorkflowRuntimeworker over gRPC to run the workflows, and an HTTPDaprClientto manage them. It sits undertest/e2e/workflow, sonpm run test:e2e:workflow(and sotest:e2e:allin CI) picks it up. No new components or scripts are needed.The tests cover:
scheduleNewWorkflowwith an explicit instance ID and with a generated one, thengetWorkflowState(instance ID, name, timestamps, input property)raiseEventdriving a workflow toCOMPLETED, with the output checkedpausetoSUSPENDED, thenresumeback toRUNNINGand on to completionterminatetoTERMINATEDpurgeof a completed and of a terminated instance, after whichgetWorkflowStaterejectsgetWorkflowStaterejecting for an unknown instancestart/get/raisealiasesThe sidecar reports status as upper-case strings such as
"RUNNING", so the tests compare against those. The SDK'sWorkflowRuntimeStatusenum insrc/types/workflowuses"Running"and so on, which doesn't match what the sidecar sends. I left that alone here to keep this PR to tests, but I can open a separate issue if that's useful.Testing: I ran
npm run build, type-checked the new test file withtsc, and ran ESLint and Prettier on it. All of them pass.npm run test:unit:allpasses too. I did not run the E2E tests locally because I don't have Docker on this machine, so CI will be their first real run.Issue reference
Closes #498
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list:
Description
This adds E2E tests for the HTTP workflow management API (
client.workflow) that #485 added. The workflow e2e suite already coversDaprWorkflowClientover gRPC, but none of it calls the HTTP management API onDaprClient(client.workflow) against a real sidecar.The new file is
test/e2e/workflow/management.test.ts. It follows the setup oftest/e2e/workflow/workflow.test.ts: aWorkflowHarnesssidecar using the shared test images, aWorkflowRuntimeworker over gRPC to run the workflows, and an HTTPDaprClientto manage them. It sits undertest/e2e/workflow, sonpm run test:e2e:workflow(and sotest:e2e:allin CI) picks it up. No new components or scripts are needed.The tests cover:
scheduleNewWorkflowwith an explicit instance ID and with a generated one, thengetWorkflowState(instance ID, name, timestamps, input property)raiseEventdriving a workflow toCOMPLETED, with the output checkedpausetoSUSPENDED, thenresumeback toRUNNINGand on to completionterminatetoTERMINATEDpurgeof a completed and of a terminated instance, after whichgetWorkflowStaterejectsgetWorkflowStaterejecting for an unknown instancestart/get/raisealiasesThe sidecar reports status as upper-case strings such as
"RUNNING", so the tests compare against those. The SDK'sWorkflowRuntimeStatusenum insrc/types/workflowuses"Running"and so on, which doesn't match what the sidecar sends. I left that alone here to keep this PR to tests, but I can open a separate issue if that's useful.Testing: I ran
npm run build, type-checked the new test file withtsc, and ran ESLint and Prettier on it. All of them pass.npm run test:unit:allpasses too. I did not run the E2E tests locally because I don't have Docker on this machine, so CI will be their first real run.Issue reference
Closes #498
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: