aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/run_python.sh
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-10-21 20:29:23 -0700
committerGravatar Masood Malekghassemi <soltanmm@users.noreply.github.com>2015-12-03 16:59:14 -0800
commit7566c9a85d03d8bedea4fc56ce7a370374b2de0e (patch)
treed029eb32664a3eb24be7f3637456714770f6b931 /tools/run_tests/run_python.sh
parent31c16e526f9f267d1f0869e39b6a0e4b87480fc2 (diff)
Make Python testing predictable again
This reorganizes the Python code, scraps the current testing infrastructure, and implements a simple test discovery and run script based on the standard Python unittest library so we can trust that our tests are running.
Diffstat (limited to 'tools/run_tests/run_python.sh')
-rwxr-xr-xtools/run_tests/run_python.sh27
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh
index 848775e9b1..9bdfbfc60c 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/run_python.sh
@@ -34,10 +34,31 @@ set -ex
cd $(dirname $0)/../..
ROOT=`pwd`
-GRPCIO_TEST=$ROOT/src/python/grpcio_test
+GRPCIO=$ROOT/src/python/grpcio
export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG
export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG
export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
-source "python"$PYVER"_virtual_environment"/bin/activate
+export CFLAGS="-I$ROOT/include -std=c89"
+export LDFLAGS="-L$ROOT/libs/$CONFIG"
+export GRPC_PYTHON_BUILD_WITH_CYTHON=1
+export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
-"python"$PYVER $GRPCIO_TEST/setup.py test -a "-n8 --cov=grpc --junitxml=./report.xml --timeout=300 -v --boxed --timeout_method=thread"
+VIRTUALENV=python"$PYVER"_virtual_environment
+source $VIRTUALENV/bin/activate
+
+(rm $GRPCIO/.coverage) || true
+(rm $GRPCIO/.coverage.*) || true
+
+if python -u $GRPCIO/setup.py test; then
+ EXIT_CODE=0
+else
+ EXIT_CODE=$?
+fi
+
+cp $GRPCIO/report.xml $ROOT
+
+cd $GRPCIO
+(coverage combine) || true
+(coverage report --include='grpc/*' --omit='grpc/framework/alpha/*','grpc/early_adopter/*','grpc/framework/base/*''grpc/framework/face/*') || true
+
+exit $EXIT_CODE