[test harness] consider an even simpler harness
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start from the create_test_harness entry point shown in the issue and inspect how a Service, VirtualObject, or Workflow is currently passed into the test harness. Implement and verify the simple_harness usage demonstrated by the sanity test, including obtaining a client and calling the greet handler.
Written by the indexing model from the issue text.
Description
@asynccontextmanager
async def simple_harness(service: Service | VirtualObject | Workflow) -> typing.AsyncIterator[restate.RestateClient]:
async with restate.create_test_harness(
restate.app([service]), restate_image="ghcr.io/restatedev/restate:latest"
) as restate_test_harness:
yield restate_test_harness.client
with that we can write tests that cover a single handler/serivce like that:
async def test_sanity():
greeter = Service("greeter")
@greeter.handler()
async def greet(ctx: Context, name: str) -> str:
return "hi"
async with simple_harness(greeter) as client:
assert "hi" == await client.service_call(greet, arg="bob")
- Dominant language
- Python
- Stars
- 81
- Forks
- 22
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from restatedev/sdk-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
restatedev/sdk-python#223 · 1 comment ·
-
Difficulty 2/5 1-2 days Newbie friendliness 68/100
restatedev/sdk-python#204 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
restatedev/sdk-python#225 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
restatedev/sdk-python#222 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
restatedev/sdk-python#221 ·
All issues in restatedev/sdk-python
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
use-agent-os/agent-os#3314 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
BasedHardware/omi#15662 · 1 comment ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
AiursoftWeb/AnduinOS-2#19 ·