fediverse-devnet / feditest

A testing framework for distributed, heterogeneous systems communicating with complex protocols, such as the Fediverse
https://feditest.org/
MIT License
27 stars 4 forks source link

[WIP] Experimental GRPC node client. #189

Closed steve-bate closed 1 week ago

steve-bate commented 1 month ago

The README.md has a few notes about using and running the code.

jernst commented 2 weeks ago

Our goal with a gRPC connector has been to make it straightforward for developers who would like their Fediverse implementation to be participating in automated tests (i.e. have an API that makes their application observable and controllable from FediTest) and who are not familiar with Python to do so without having to learn a whole lot of stuff, such as sufficient Python and how to connect Python code to their own code.

I did not realize that gRPC has quite a learning curve itself until I tried it out making my own code controllable and observable from gRPC. Based on that experience, I now doubt that providing a gRPC connector substantially reduces the cost of connecting another application into FediTest.

I wonder whether we can come up with something much simpler, such as asking developer to add a minimal version of a JSON-RPC server. Instead of having to 1) add new libraries unfamiliar to the developer 2) figuring out how to open up an extra port and running a service there, or adding a gRPC endpoint into their existing URL namespace, 3) figuring out how to do the marshalling and unmarshalling of gRPC-provided parameters, 4) making their build process more complex, etc etc ...

Can we get away with something like (taking a hypothetical PHP application as an example):

We could even provide simple templates for how to do this in various languages to make it real easy. I would expect those templates to be no more than a couple hundred lines each and very easy to understand -- sort of like what the gRPC code generator spits out on the server side, but much more approachable.

Many of the things that gRPC addresses and that cause it to be complex -- like optimized on-the-wire data layout -- are entirely unimportant for us here, while ease of use is paramount for us, so maybe gRPC is not for us here.

Thinking aloud here ...

steve-bate commented 1 week ago

Given the concerns about GRPC complexity, I'm going to close this PR.