Enable unit testing for Dapr Workflows#1035
Merged
Merged
Conversation
halspang
reviewed
Feb 14, 2023
halspang
left a comment
Contributor
There was a problem hiding this comment.
Code is fine overall, hooray testing! Just some nit-picks you can feel free to ignore. However, you do have a build issue that you'll need to look into.
Codecov Report
@@ Coverage Diff @@
## master #1035 +/- ##
=======================================
Coverage 69.47% 69.47%
=======================================
Files 162 162
Lines 5432 5432
Branches 585 585
=======================================
Hits 3774 3774
Misses 1518 1518
Partials 140 140
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
cgillum
force-pushed
the
workflow-testing
branch
from
February 16, 2023 18:11
cb5ed3e to
e2a0fd4
Compare
3 tasks
halspang
previously approved these changes
Feb 16, 2023
Signed-off-by: Chris Gillum <[email protected]>
Signed-off-by: Chris Gillum <[email protected]>
cgillum
force-pushed
the
workflow-testing
branch
from
February 16, 2023 18:59
e2a0fd4 to
f9381ff
Compare
halspang
approved these changes
Feb 16, 2023
yash-nisar
pushed a commit
to yash-nisar/dotnet-sdk
that referenced
this pull request
Feb 27, 2023
* Workflow SDK changes to enable unit testing Signed-off-by: Chris Gillum <[email protected]> * Sample workflow unit testing project Signed-off-by: Chris Gillum <[email protected]> --------- Signed-off-by: Chris Gillum <[email protected]>
4 tasks
|
Hi Dapr team, @cgillum , In which release version of .Net SDK we have that available? |
Contributor
Author
|
@halspang do you know the answer? |
|
Hi @halspang , Kindly provide the Dapr sdk release where this feature is available. Thanks a lot! |
This was referenced Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
An early user of Dapr Workflow pointed out that they aren't able to unit test their workflows. This PR addresses that problem by:
WorkflowContexta mockable abstract base classThe new unit test project isn't meant as an actual test to be run by us, but as a reference for developers so that they can learn how to write their own unit tests for workflows.
Note that the unit test project references the workflow console app sample, so I made many of the types in that sample
publicso that they could be easily tested from another project.I also found a bug while refactoring the
WorkflowContext- calls toWorkflowContext.SendEvent()would have resulted in aStackOverflowException. That is fixed in this PR too.Issue reference
Resolves #1034
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: