Re: [grpc-io] Re: grpcio_testing code samples

2022-01-24 Thread 'Lidi Zheng' via grpc.io
The grpc-testing package is for mocking the services. It can intercept 
messages, inject logic, alter timestamp.

How to write tests is a programming philosophy question. In most of the 
gRPC Python tests, we try to use "end2end" style tests, conduct tests only 
using the public API.

On Saturday, December 4, 2021 at 12:53:56 PM UTC-8 M T wrote:

> One thing I just noticed that I didn't include in my original request: I'm 
> looking for examples on how to write tests for *python* grpc services & 
> clients.
>
> Thanks for getting back to me - but unfortunately, neither link helps:
>
> * https://github.com/grpc/grpc/tree/master/examples only contains usage 
> examples of actually implementing services / clients, but not about  how to 
> test them
> * https://github.com/grpc/grpc/tree/master/test only contains a bunch of 
> .cc files, which don't help in my case, since I'm looking for python unit 
> tests, and the only python-related files I could find in there where about 
> testing the generation of the wheels that are required for the python 
> grpcio packages
>
> When I said "the documentation only lists what classes / methods exist, 
> but not how to use them", I was talking about this: 
> https://grpc.github.io/grpc/python/grpc_testing.html - and this is quite 
> cryptic to a newbie like me. A simple example (e.g. unit tests for the 
> hello world example) would be enough to get started, but the way it is, I 
> can't really make sense of any of these classes. And googling also didn't 
> provide me with any kind of guidance on the python grpc test classes. A 
> possible place to add such an example would be 
> https://grpc.io/docs/languages/python/basics/, I guess, which contains 
> the hello world example for python.
>
> On Wed, Dec 1, 2021 at 8:10 PM 'yas...@google.com' via grpc.io <
> grp...@googlegroups.com> wrote:
>
>> Thank you for the feedback! Do the examples in 
>> https://github.com/grpc/grpc/tree/master/examples and 
>> https://github.com/grpc/grpc/tree/master/test help?
>>
>> On Tuesday, November 16, 2021 at 6:32:13 AM UTC-8 M T wrote:
>>
>>> Hi all,
>>>
>>> I'm just starting to get into grpc, and was wondering about tests. The 
>>> documentation of the testing package only lists what classes etc. are 
>>> available, but not really how to use them - would it be possible to add 
>>> small testing examples to the general code examples, to help people 
>>> starting out?
>>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "grpc.io" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/grpc-io/pNIulgyXSQ0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> grpc-io+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/a787b200-e683-4a48-9d90-f1da02430f41n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/eb364618-65c1-42c6-8950-a36412d62623n%40googlegroups.com.


Re: [grpc-io] Re: grpcio_testing code samples

2021-12-04 Thread M T
One thing I just noticed that I didn't include in my original request: I'm
looking for examples on how to write tests for *python* grpc services &
clients.

Thanks for getting back to me - but unfortunately, neither link helps:

* https://github.com/grpc/grpc/tree/master/examples only contains usage
examples of actually implementing services / clients, but not about  how to
test them
* https://github.com/grpc/grpc/tree/master/test only contains a bunch of
.cc files, which don't help in my case, since I'm looking for python unit
tests, and the only python-related files I could find in there where about
testing the generation of the wheels that are required for the python
grpcio packages

When I said "the documentation only lists what classes / methods exist, but
not how to use them", I was talking about this:
https://grpc.github.io/grpc/python/grpc_testing.html - and this is quite
cryptic to a newbie like me. A simple example (e.g. unit tests for the
hello world example) would be enough to get started, but the way it is, I
can't really make sense of any of these classes. And googling also didn't
provide me with any kind of guidance on the python grpc test classes. A
possible place to add such an example would be
https://grpc.io/docs/languages/python/basics/, I guess, which contains the
hello world example for python.

On Wed, Dec 1, 2021 at 8:10 PM 'yas...@google.com' via grpc.io <
grpc-io@googlegroups.com> wrote:

> Thank you for the feedback! Do the examples in
> https://github.com/grpc/grpc/tree/master/examples and
> https://github.com/grpc/grpc/tree/master/test help?
>
> On Tuesday, November 16, 2021 at 6:32:13 AM UTC-8 M T wrote:
>
>> Hi all,
>>
>> I'm just starting to get into grpc, and was wondering about tests. The
>> documentation of the testing package only lists what classes etc. are
>> available, but not really how to use them - would it be possible to add
>> small testing examples to the general code examples, to help people
>> starting out?
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "grpc.io" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/grpc-io/pNIulgyXSQ0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/a787b200-e683-4a48-9d90-f1da02430f41n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALKNHccZtXuQSeAvRaUbSU-maBSTDnnrpkrJpn9xk-%2BQcW5MVQ%40mail.gmail.com.


[grpc-io] Re: grpcio_testing code samples

2021-12-01 Thread 'yas...@google.com' via grpc.io
Thank you for the feedback! Do the examples 
in https://github.com/grpc/grpc/tree/master/examples 
and https://github.com/grpc/grpc/tree/master/test help?

On Tuesday, November 16, 2021 at 6:32:13 AM UTC-8 M T wrote:

> Hi all,
>
> I'm just starting to get into grpc, and was wondering about tests. The 
> documentation of the testing package only lists what classes etc. are 
> available, but not really how to use them - would it be possible to add 
> small testing examples to the general code examples, to help people 
> starting out?
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/a787b200-e683-4a48-9d90-f1da02430f41n%40googlegroups.com.