diff options
-rwxr-xr-x | tools/run_tests/helper_scripts/run_grpc-node.sh | 28 | ||||
-rw-r--r-- | tools/run_tests/python_utils/filter_pull_request_tests.py | 2 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 62 | ||||
-rwxr-xr-x | tools/run_tests/run_tests_matrix.py | 2 | ||||
-rwxr-xr-x | tools/run_tests/sanity/check_test_filtering.py | 2 |
5 files changed, 93 insertions, 3 deletions
diff --git a/tools/run_tests/helper_scripts/run_grpc-node.sh b/tools/run_tests/helper_scripts/run_grpc-node.sh new file mode 100755 index 0000000000..25f149f579 --- /dev/null +++ b/tools/run_tests/helper_scripts/run_grpc-node.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# Copyright 2015 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This script runs grpc/grpc-node tests with their grpc submodule updated +# to this reference + +# cd to gRPC root directory +cd $(dirname $0)/../../.. + +CURRENT_COMMIT=$(git rev-parse --verify HEAD) + +rm -rf ./../grpc-node +git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node +cd ./../grpc-node + +./test-grpc-submodule.sh $CURRENT_COMMIT diff --git a/tools/run_tests/python_utils/filter_pull_request_tests.py b/tools/run_tests/python_utils/filter_pull_request_tests.py index f99143fdd7..393aef8662 100644 --- a/tools/run_tests/python_utils/filter_pull_request_tests.py +++ b/tools/run_tests/python_utils/filter_pull_request_tests.py @@ -47,7 +47,7 @@ class TestSuite: _CORE_TEST_SUITE = TestSuite(['c']) _CPP_TEST_SUITE = TestSuite(['c++']) _CSHARP_TEST_SUITE = TestSuite(['csharp']) -_NODE_TEST_SUITE = TestSuite(['node']) +_NODE_TEST_SUITE = TestSuite(['node', 'grpc-node']) _OBJC_TEST_SUITE = TestSuite(['objc']) _PHP_TEST_SUITE = TestSuite(['php', 'php7']) _PYTHON_TEST_SUITE = TestSuite(['python']) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 6697149dd9..6e2115c279 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -444,6 +444,67 @@ class CLanguage(object): return self.make_target +# This tests Node on grpc/grpc-node and will become the standard for Node testing +class RemoteNodeLanguage(object): + + def __init__(self): + self.platform = platform_string() + + def configure(self, config, args): + self.config = config + self.args = args + # Note: electron ABI only depends on major and minor version, so that's all + # we should specify in the compiler argument + _check_compiler(self.args.compiler, ['default', 'node0.12', + 'node4', 'node5', 'node6', + 'node7', 'node8', + 'electron1.3', 'electron1.6']) + if self.args.compiler == 'default': + self.runtime = 'node' + self.node_version = '8' + else: + if self.args.compiler.startswith('electron'): + self.runtime = 'electron' + self.node_version = self.args.compiler[8:] + else: + self.runtime = 'node' + # Take off the word "node" + self.node_version = self.args.compiler[4:] + + # TODO: update with Windows/electron scripts when available for grpc/grpc-node + def test_specs(self): + if self.platform == 'windows': + return [self.config.job_spec(['tools\\run_tests\\helper_scripts\\run_node.bat'])] + else: + return [self.config.job_spec(['tools/run_tests/helper_scripts/run_grpc-node.sh'], + None, + environ=_FORCE_ENVIRON_FOR_WRAPPERS)] + + def pre_build_steps(self): + return [] + + def make_targets(self): + return [] + + def make_options(self): + return [] + + def build_steps(self): + return [] + + def post_tests_steps(self): + return [] + + def makefile_name(self): + return 'Makefile' + + def dockerfile_dir(self): + return 'tools/dockerfile/test/node_jessie_%s' % _docker_arch_suffix(self.args.arch) + + def __str__(self): + return 'grpc-node' + + class NodeLanguage(object): def __init__(self): @@ -1067,6 +1128,7 @@ with open('tools/run_tests/generated/configs.json') as f: _LANGUAGES = { 'c++': CLanguage('cxx', 'c++'), 'c': CLanguage('c', 'c'), + 'grpc-node': RemoteNodeLanguage(), 'node': NodeLanguage(), 'node_express': NodeExpressLanguage(), 'php': PhpLanguage(), diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 2417c5ae55..34d839e0b8 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -169,7 +169,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS): inner_jobs=inner_jobs, timeout_seconds=_CPP_RUNTESTS_TIMEOUT) - test_jobs += _generate_jobs(languages=['ruby', 'php'], + test_jobs += _generate_jobs(languages=['grpc-node', 'ruby', 'php'], configs=['dbg', 'opt'], platforms=['linux', 'macos'], labels=['basictests', 'multilang'], diff --git a/tools/run_tests/sanity/check_test_filtering.py b/tools/run_tests/sanity/check_test_filtering.py index bea8125fb9..3ebb9389f7 100755 --- a/tools/run_tests/sanity/check_test_filtering.py +++ b/tools/run_tests/sanity/check_test_filtering.py @@ -25,7 +25,7 @@ sys.path.insert(0, os.path.abspath('tools/run_tests/')) from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs import python_utils.filter_pull_request_tests as filter_pull_request_tests -_LIST_OF_LANGUAGE_LABELS = ['c', 'c++', 'csharp', 'node', 'objc', 'php', 'php7', 'python', 'ruby'] +_LIST_OF_LANGUAGE_LABELS = ['c', 'c++', 'csharp', 'grpc-node', 'node', 'objc', 'php', 'php7', 'python', 'ruby'] _LIST_OF_PLATFORM_LABELS = ['linux', 'macos', 'windows'] class TestFilteringTest(unittest.TestCase): |