Skip to content

tests(workflow): add E2E tests for workflow management - #946

Merged
WhitWaldo merged 2 commits into
dapr:mainfrom
devxsubh:oss/issue-498
Nov 12, 2026
Merged

WhitWaldo merged 2 commits into
dapr:mainfrom
devxsubh:oss/issue-498

Conversation

@devxsubh

@devxsubh devxsubh commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

This adds E2E tests for the HTTP workflow management API (client.workflow) that #485 added. The workflow e2e suite already covers DaprWorkflowClient over gRPC, but none of it calls the HTTP management API on DaprClient (client.workflow) against a real sidecar.

The new file is test/e2e/workflow/management.test.ts. It follows the setup of test/e2e/workflow/workflow.test.ts: a WorkflowHarness sidecar using the shared test images, a WorkflowRuntime worker over gRPC to run the workflows, and an HTTP DaprClient to manage them. It sits under test/e2e/workflow, so npm run test:e2e:workflow (and so test:e2e:all in CI) picks it up. No new components or scripts are needed.

The tests cover:

  • scheduleNewWorkflow with an explicit instance ID and with a generated one, then getWorkflowState (instance ID, name, timestamps, input property)
  • raiseEvent driving a workflow to COMPLETED, with the output checked
  • pause to SUSPENDED, then resume back to RUNNING and on to completion
  • terminate to TERMINATED
  • purge of a completed and of a terminated instance, after which getWorkflowState rejects
  • getWorkflowState rejecting for an unknown instance
  • the deprecated start / get / raise aliases

The sidecar reports status as upper-case strings such as "RUNNING", so the tests compare against those. The SDK's WorkflowRuntimeStatus enum in src/types/workflow uses "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 with tsc, and ran ESLint and Prettier on it. All of them pass. npm run test:unit:all passes 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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Description

This adds E2E tests for the HTTP workflow management API (client.workflow) that #485 added. The workflow e2e suite already covers DaprWorkflowClient over gRPC, but none of it calls the HTTP management API on DaprClient (client.workflow) against a real sidecar.

The new file is test/e2e/workflow/management.test.ts. It follows the setup of test/e2e/workflow/workflow.test.ts: a WorkflowHarness sidecar using the shared test images, a WorkflowRuntime worker over gRPC to run the workflows, and an HTTP DaprClient to manage them. It sits under test/e2e/workflow, so npm run test:e2e:workflow (and so test:e2e:all in CI) picks it up. No new components or scripts are needed.

The tests cover:

  • scheduleNewWorkflow with an explicit instance ID and with a generated one, then getWorkflowState (instance ID, name, timestamps, input property)
  • raiseEvent driving a workflow to COMPLETED, with the output checked
  • pause to SUSPENDED, then resume back to RUNNING and on to completion
  • terminate to TERMINATED
  • purge of a completed and of a terminated instance, after which getWorkflowState rejects
  • getWorkflowState rejecting for an unknown instance
  • the deprecated start / get / raise aliases

The sidecar reports status as upper-case strings such as "RUNNING", so the tests compare against those. The SDK's WorkflowRuntimeStatus enum in src/types/workflow uses "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 with tsc, and ran ESLint and Prettier on it. All of them pass. npm run test:unit:all passes 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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

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
devxsubh requested review from a team as code owners November 8, 2026 08:50
@WhitWaldo

WhitWaldo commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

@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:

but nothing ran client.workflow against a real sidecar.

...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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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, and raise aliases.

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

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.13%. Comparing base (7c0c2b0) to head (f1ebf62).

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           
Flag Coverage Δ
e2e 22.00% <ø> (ø)
unit 81.96% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@devxsubh

Copy link
Copy Markdown
Contributor Author

Thanks for looking, @WhitWaldo, and you're right that the sentence was too broad. What I meant: the workflow E2E suite drives workflows through DaprWorkflowClient (the gRPC API). None of it calls the HTTP management API on DaprClient (client.workflow.scheduleNewWorkflow, getWorkflowState, raiseEvent, pause, resume, terminate, purge, and the deprecated start/get/raise), which goes through src/implementation/Client/HTTPClient/workflow.ts. The only tests calling client.workflow today are the mocked unit tests in test/unit/protocols/common/serialization.test.ts. So these tests cover that HTTP path rather than repeating the gRPC ones. I'll update the description to say so. If you'd rather not have E2E coverage for the HTTP API, I'm happy to close this.

@WhitWaldo

Copy link
Copy Markdown
Contributor

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 WhitWaldo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - thank you!

@WhitWaldo
WhitWaldo merged commit 089fb07 into dapr:main Nov 12, 2026
11 checks passed
@marcduiker

Copy link
Copy Markdown
Contributor

@holopin-bot @devxsubh sdk-badge Thank you! Here's a digital badge as a small token of appreciation.

@holopin-bot

holopin-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

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.
Or if you're new to Holopin, you can simply sign up with GitHub, which will do the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests(workflow): add E2E tests for workflows management

4 participants