From b2d4a8de95c160d42c6f1e3edf582d7321226dbb Mon Sep 17 00:00:00 2001
From: Masood Malekghassemi <soltanmm@users.noreply.github.com>
Date: Thu, 5 Mar 2015 17:04:18 -0800
Subject: [PATCH] Have Python protoc plugin test run with other tests

---
 tools/run_tests/python_tests.json | 64 +++++++++++++++++++++++--------
 tools/run_tests/run_python.sh     |  2 +-
 tools/run_tests/run_tests.py      | 11 ++++--
 3 files changed, 57 insertions(+), 20 deletions(-)

diff --git a/tools/run_tests/python_tests.json b/tools/run_tests/python_tests.json
index 9e5b1365e6..4b43ee8357 100755
--- a/tools/run_tests/python_tests.json
+++ b/tools/run_tests/python_tests.json
@@ -1,18 +1,50 @@
 [
-  "grpc._adapter._blocking_invocation_inline_service_test",
-  "grpc._adapter._c_test",
-  "grpc._adapter._event_invocation_synchronous_event_service_test",
-  "grpc._adapter._future_invocation_asynchronous_event_service_test",
-  "grpc._adapter._links_test",
-  "grpc._adapter._lonely_rear_link_test",
-  "grpc._adapter._low_test",
-  "grpc.early_adopter.implementations_test",
-  "grpc.framework.assembly.implementations_test",
-  "grpc.framework.base.packets.implementations_test",
-  "grpc.framework.face.blocking_invocation_inline_service_test",
-  "grpc.framework.face.event_invocation_synchronous_event_service_test",
-  "grpc.framework.face.future_invocation_asynchronous_event_service_test",
-  "grpc.framework.foundation._later_test",
-  "grpc.framework.foundation._logging_pool_test"
+  {
+    "file": "test/compiler/python_plugin_test.py"
+  },
+  {
+    "module": "grpc._adapter._blocking_invocation_inline_service_test"
+  },
+  {
+    "module": "grpc._adapter._c_test"
+  },
+  {
+    "module": "grpc._adapter._event_invocation_synchronous_event_service_test"
+  },
+  {
+    "module": "grpc._adapter._future_invocation_asynchronous_event_service_test"
+  },
+  {
+    "module": "grpc._adapter._links_test"
+  },
+  {
+    "module": "grpc._adapter._lonely_rear_link_test"
+  },
+  {
+    "module": "grpc._adapter._low_test"
+  },
+  {
+    "module": "grpc.early_adopter.implementations_test"
+  },
+  {
+    "module": "grpc.framework.assembly.implementations_test"
+  },
+  {
+    "module": "grpc.framework.base.packets.implementations_test"
+  },
+  {
+    "module": "grpc.framework.face.blocking_invocation_inline_service_test"
+  },
+  {
+    "module": "grpc.framework.face.event_invocation_synchronous_event_service_test"
+  },
+  {
+    "module": "grpc.framework.face.future_invocation_asynchronous_event_service_test"
+  },
+  {
+    "module": "grpc.framework.foundation._later_test"
+  },
+  {
+    "module": "grpc.framework.foundation._logging_pool_test"
+  }
 ]
-
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh
index 403862b0a0..fa1497aee4 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/run_python.sh
@@ -36,4 +36,4 @@ cd $(dirname $0)/../..
 root=`pwd`
 export LD_LIBRARY_PATH=$root/libs/opt
 source python2.7_virtual_environment/bin/activate
-python2.7 -B -m $*
+python2.7 -B $*
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 0f4544a5c6..12a45f3ad9 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -170,11 +170,16 @@ class PythonLanguage(object):
       self._tests = json.load(f)
 
   def test_specs(self, config, travis):
-    return [config.job_spec(['tools/run_tests/run_python.sh', test], None)
-            for test in self._tests]
+    modules = [config.job_spec(['tools/run_tests/run_python.sh', '-m',
+                                test['module']], None)
+               for test in self._tests if 'module' in test]
+    files = [config.job_spec(['tools/run_tests/run_python.sh',
+                              test['file']], None)
+             for test in self._tests if 'file' in test]
+    return files + modules
 
   def make_targets(self):
-    return ['static_c']
+    return ['static_c', 'grpc_python_plugin']
 
   def build_steps(self):
     return [['tools/run_tests/build_python.sh']]
-- 
GitLab