grpcio_testing Documentation

1,851 views
Skip to first unread message

Beth Anderson

unread,
Apr 19, 2018, 8:54:30 AM4/19/18
to grpc.io

Hi all,

I'm interested in this module https://github.com/grpc/grpc/tree/master/src/python/grpcio_testing and wondered if there are any docs or code samples for it? To test my Python gRPC project.

Thanks,

Beth

Beth Anderson

unread,
Apr 19, 2018, 10:19:07 AM4/19/18
to grpc.io
Rather stupidly I've realised there are tests here:


...although if there are any docs, I'd be really grateful for the links...

Nathaniel Manista

unread,
Apr 19, 2018, 11:57:35 AM4/19/18
to Beth Anderson, grpc.io
There's... less documentation than we'd like, especially around the grpc_testing package (note that it isn't even yet released on PyPI...).

Have you yet used run_tests ("./tools/run_tests/run_tests.py --language=python --compiler=all_the_cpythons --newline_on_success") to run our tests? If not, that would be the right place to start. If so: we expect that you'd be able to write tests of your system that uses gRPC Python that have more or less the same shape as our own tests of gRPC Python. I usually say that _rpc_test is the right place to start reading the tests of gRPC Python as that tests the core behavior and primary features of the library. Something like the intraop tests ("intraop" means "the Python implementations of the implementation-interoperation suite, but run against one another rather than against other gRPC implementations") is more representative of critical user journeys but has a lot more going on.

Please do follow up with how your testing progresses; this is a topic about which we've heard less from developers than we'd like.
-Nathaniel

Beth Anderson

unread,
Apr 19, 2018, 6:09:38 PM4/19/18
to grpc.io
Thanks Nathaniel, that's really helpful!

I've been working on some testing based on rpc_test and test_common etc which I might post here for review, if that's possible?

It looks really great and I'm really keen to get a good testing framework for our gRPC microservices.

Thanks,

Beth

Beth Anderson

unread,
Apr 23, 2018, 8:17:25 AM4/23/18
to grpc.io
I've been hacking away with the grpco_testing package and it's really interesting, although I'm not sure I understand it yet. :)

In the meanwhile, I've been toying with a couple of tests; one is more of an integration test and actually runs the server and the other is more of a unit test which tests only the implementation of the service itself, ignoring the gRPC scaffold.


Any thoughts?


On Thursday, April 19, 2018 at 1:54:30 PM UTC+1, Beth Anderson wrote:

Beth Anderson

unread,
Apr 23, 2018, 8:40:29 AM4/23/18
to grpc.io
Sorry, probably easier to just look at master: https://github.com/betandr/grpcdemo/blob/master/tests/helloworld_test.py

Nathaniel Manista

unread,
Jun 11, 2018, 6:22:32 PM6/11/18
to Beth Anderson, grpc.io
On Thu, Apr 19, 2018 at 3:09 PM Beth Anderson <b...@andr.io> wrote:
I've been working on some testing based on rpc_test and test_common etc which I might post here for review, if that's possible?

Ordinary answer: sure, link us to it and ask us what questions you have about it?

Weird answer: it looks like you sent two more messages to this thread than ever landed in my inbox. Spooky. Do you still have questions about that code, or have your circumstances changed?

It looks really great and I'm really keen to get a good testing framework for our gRPC microservices.

We'd very much like to release the grpcio_testing package; we've just been working on tasks that we'd like to complete even more.
-Nathaniel
Reply all
Reply to author
Forward
0 new messages