Skip to content

Add test harness #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 7, 2025
Merged

Conversation

igalshilman
Copy link
Contributor

@igalshilman igalshilman commented Feb 6, 2025

pip install restate_sdk[harness]
greeter = Service("greeter")

@greeter.handler()
async def greet(ctx: Context, name: str) -> str:
    return f"Hello {name}!"

app = restate.app(services=[greeter])
import restate

with restate.test_harness(app) as harness:
    cli = harness.ingress_client()
    print(cli.post("/greeter/greet", json="Alice").json())


self.network = Network().create()

self.restate = RestateContainer(image="restatedev/restate:1.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be latest, otherwise we need to bump the python sdk every time we update the runtime. Plus i find counterintuitive that we decide here to pin to some version X.

Let the user override the restate image though, so everyone's happy and can pin to a specific restate version if they need to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yah totally, it is a draft for a reason.

@igalshilman igalshilman marked this pull request as ready for review February 7, 2025 15:29
@igalshilman igalshilman merged commit aac3abc into restatedev:main Feb 7, 2025
3 checks passed
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.

2 participants