dapr / dapr/js-sdk

Richer E2E Tests demonstrating WorkflowRuntimeStatus

Open
#660 0 comments 0 reactions 0 assignees View on GitHub
area/workflow
Dominant language
JavaScript
Stars
217
Forks
104
PR merge metrics
No merged PRs in 30d

Description

**Description:**
I’d like to request more end-to-end (E2E) tests to validate how `DaprWorkflowClient` retrieves the expected `WorkflowRuntimeStatus` from Dapr when running a workflow instance. Clear examples would help ensure users understand the expected status transitions in different scenarios.

For example, it would be helpful to see a test demonstrating how `DaprWorkflowClient` interacts with workflow states:

```typescript
const workflowClient = new DaprWorkflowClient();
await workflowClient.terminateWorkflow(id, "some reason for termination");
const state = await getWorkflowState(id, false);
expect(state?.runtimeStatus).toEqual(WorkflowRuntimeStatus.TERMINATED);
```

### **Request for Enhancement:**
Could additional E2E tests be added to cover different workflow scenarios and validate `WorkflowRuntimeStatus`? These tests would clarify when specific statuses are triggered and improve developer confidence in using the SDK.

### **WorkflowRuntimeStatus Values to Cover:**
1. **RUNNING** – The workflow is actively executing.
2. **COMPLETED** – The workflow has finished successfully.
3. **FAILED** – The workflow encountered an error and failed.
4. **TERMINATED** – The workflow was forcefully stopped before completion.
5. **CONTINUED_AS_NEW** – The workflow instance has completed but started a new instance as a continuation.
6. **PENDING** – The workflow is scheduled but has not started yet.
7. **SUSPENDED** – The workflow is paused and waiting to be resumed.

These tests would help ensure that `DaprWorkflowClient` correctly reflects workflow runtime statuses under different conditions.

Thanks for your consideration! 🚀

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.