Add interop tests for gRPC Python. py_proto_library rules are added to
src/proto/grpc/testing/BUILD since grpc_proto_library is not compatible
with py_* rules.
'requests' python module is added to requirements.bazel.txt as it is a
dependency for google-auth. Previously, this was installed through
tools/run_tests/helper_scripts/build_python.sh before running tests.
If the last reference to a Python object is at module scope, when
its destructor is run before program termination it may find that
the globals it requires no longer exist. Destructors of objects
likely to be stored at module global scope need to check that
globals exist before attempting to use them, to avoid warnings
being printed by the Python interpreter.
See grpc#17004
* unit test included
* throw ValueError exception from Cython to Python
* prevent the deconstruction method from failing when Channel initialization failed
Add interop tests for gRPC Python. py_proto_library rules are added to
src/proto/grpc/testing/BUILD since grpc_proto_library is not compatible
with py_* rules.
'requests' python module is added to requirements.bazel.txt as it is a
dependency for google-auth. Previously, this was installed through
tools/run_tests/helper_scripts/build_python.sh before running tests.
Add Bazel rules for building and testing grpcio_health_checking.
An unofficial fork for rules_protobuf is used for now as it incorporates
a change (#196 by duduko on the upstream repo pubref/rules_protobuf)
which allows the protoc compiler to compile generated protos too. This
was not merged because the change was failing for golang, but works as
expected for Python.
This is needed because grpcio_health_checking fetches it's proto file
from a different directory (previously achived through setup.py) and
thus needs to be moved to the required location within bazel-genfiles
using a genrule.
There are exactly 50 tests under grpcio_tests/tests/testing and
grpcio_tests/tests/unit for gRPC Python. Add Bazel targets for 44 of
them. unit._reconnect_test has been left out for now due to an
unexpected RuntimeError (#16336) and unit._server_ssl_cert_config_test
because of changes needed to the import path within
src/python/grpcio_tests/tests/testing/proto/services.proto (will
possibly be included as a fix to #15370).
The count of tests here is reported the way unittest counts tests, which
is the number of individual unit test classes it sees. This will be
different from Bazel's count, which counts the number of Bazel test
targets, which (by convention mostly) is one per test module.