-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I'm using restate for the first time and the project looks great, but the ergonomics for unit testing could be improved.
There are two main issues:
- When defining a trait for a workflow or a service self must not be present.
#[restate_sdk::workflow]
trait MyWorkflow {
fn do_something(); // No self
}
This means that regular mocking libraries cannot be used with these traits. The restate macro adds self
which honestly is confusing. Why not just require the trait functions to take self
rather than add it magically?
Contex
cannot be constructed and therefore any function that takes context cannot be unit tested. I want to test failure of my workflows for error handling,testcontainers
is not a good fit as I will need to be able to set expectations and failures in a fine grained way.
It'd be great if Restate could provide unit test support for Context. The only solution I can see right now is to abstract Restate apis away completely in my codebase.
akkie
Metadata
Metadata
Assignees
Labels
No labels