chore: add more tests for service bindings#118
Conversation
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
This PR adds end-to-end service binding tests covering RPC calls (identity, multi-arg, defaults), unsupported types, and fetch forwarding.
- Minor: Misleading noqa comment — The
ServiceBindingimport comment says "side effect of registering the Durable Object" butServiceBindingis aWorkerEntrypoint, not aDurableObject.
|
Review posted on PR #118. The only actionable finding was a misleading copy-pasted noqa comment — |
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
|
GitHub supports stacked PRs now, doesn't it? https://github.github.com/gh-stack/ |
|
Yeah, but I think it is still in the private beta that is not enabled for this org. |
dom96
left a comment
There was a problem hiding this comment.
If we're duplicating tests, maybe we could deduplicate somehow or remove the other test cases if these give better test coverage?
| async def test_identity_primitives(env): | ||
| svc = env.SERVICE_BINDING | ||
| assert await svc.identity("hello") == "hello" | ||
| assert await svc.identity(42) == 42 | ||
| assert await svc.identity(3.14) - 3.14 < 0.001 | ||
| assert await svc.identity(True) is True | ||
| assert await svc.identity(False) is False | ||
| assert await svc.identity(None) is None |
There was a problem hiding this comment.
How are these different to the tests we already do in python-rpc workerd tests?
This on top of #113 (I want stacked PRs...)
Adds some service-bindings related tests. This PR purely updates test without changing SDK.
Some of them are duplicate of sdk_tests.py but I wanted to locate the bindings related tests in the same directory + run a full e2e test using pywrangler.