aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests')
-rw-r--r--tools/run_tests/artifact_targets.py20
-rw-r--r--tools/run_tests/build_node.bat14
-rwxr-xr-xtools/run_tests/build_python.sh9
-rw-r--r--tools/run_tests/post_test_node.bat30
-rw-r--r--tools/run_tests/pre_build_node.bat11
-rwxr-xr-xtools/run_tests/run_interop_tests.py12
-rw-r--r--tools/run_tests/run_node.bat1
-rwxr-xr-xtools/run_tests/run_python.sh9
-rwxr-xr-xtools/run_tests/run_tests.py70
-rw-r--r--tools/run_tests/sanity/sanity_tests.yaml1
-rw-r--r--tools/run_tests/sources_and_headers.json32
-rw-r--r--tools/run_tests/tests.json42
12 files changed, 169 insertions, 82 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py
index 288a3f0154..e61c46d8b5 100644
--- a/tools/run_tests/artifact_targets.py
+++ b/tools/run_tests/artifact_targets.py
@@ -69,16 +69,6 @@ def create_jobspec(name, cmdline, environ=None, shell=False,
return jobspec
-def macos_arch_env(arch):
- """Returns environ specifying -arch arguments for make."""
- if arch == 'x86':
- arch_arg = '-arch i386'
- elif arch == 'x64':
- arch_arg = '-arch x86_64'
- else:
- raise Exception('Unsupported arch')
- return {'CFLAGS': arch_arg, 'LDFLAGS': arch_arg}
-
_MACOS_COMPAT_FLAG = '-mmacosx-version-min=10.7'
_ARCH_FLAG_MAP = {
@@ -191,13 +181,17 @@ class CSharpExtArtifact:
environ = {'CONFIG': 'opt',
'EMBED_OPENSSL': 'true',
'EMBED_ZLIB': 'true',
- 'CFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE'}
+ 'CFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE',
+ 'LDFLAGS': ''}
if self.platform == 'linux':
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_linux_%s' % self.arch,
- 'tools/run_tests/build_artifact_csharp.sh')
+ 'tools/run_tests/build_artifact_csharp.sh',
+ environ=environ)
else:
- environ.update(macos_arch_env(self.arch))
+ archflag = _ARCH_FLAG_MAP[self.arch]
+ environ['CFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG)
+ environ['LDFLAGS'] += ' %s' % archflag
return create_jobspec(self.name,
['tools/run_tests/build_artifact_csharp.sh'],
environ=environ)
diff --git a/tools/run_tests/build_node.bat b/tools/run_tests/build_node.bat
index 6896bc1d1b..82e8208348 100644
--- a/tools/run_tests/build_node.bat
+++ b/tools/run_tests/build_node.bat
@@ -27,4 +27,16 @@
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-npm install --build-from-source \ No newline at end of file
+set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
+
+del /f /q BUILD || rmdir build /s /q
+
+call npm install --build-from-source
+
+@rem delete the redundant openssl headers
+for /f "delims=v" %%v in ('node --version') do (
+ rmdir "%USERPROFILE%\.node-gyp\%%v\include\node\openssl" /S /Q
+)
+
+@rem rebuild, because it probably failed the first time
+call npm install --build-from-source \ No newline at end of file
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh
index e0fcbb602d..79a148faf1 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/build_python.sh
@@ -40,8 +40,15 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
export CFLAGS="-I$ROOT/include -std=gnu99"
export LDFLAGS="-L$ROOT/libs/$CONFIG"
export GRPC_PYTHON_BUILD_WITH_CYTHON=1
-export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
+
+if [ "$CONFIG" = "gcov" ]
+then
+ export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
+fi
tox --notest
$ROOT/.tox/py27/bin/python $ROOT/setup.py build
+$ROOT/.tox/py27/bin/python $ROOT/setup.py build_py
+$ROOT/.tox/py27/bin/python $ROOT/setup.py build_ext --inplace
+$ROOT/.tox/py27/bin/python $ROOT/setup.py gather --test
diff --git a/tools/run_tests/post_test_node.bat b/tools/run_tests/post_test_node.bat
deleted file mode 100644
index 1a2a5491fa..0000000000
--- a/tools/run_tests/post_test_node.bat
+++ /dev/null
@@ -1,30 +0,0 @@
-@rem Copyright 2016, Google Inc.
-@rem All rights reserved.
-@rem
-@rem Redistribution and use in source and binary forms, with or without
-@rem modification, are permitted provided that the following conditions are
-@rem met:
-@rem
-@rem * Redistributions of source code must retain the above copyright
-@rem notice, this list of conditions and the following disclaimer.
-@rem * Redistributions in binary form must reproduce the above
-@rem copyright notice, this list of conditions and the following disclaimer
-@rem in the documentation and/or other materials provided with the
-@rem distribution.
-@rem * Neither the name of Google Inc. nor the names of its
-@rem contributors may be used to endorse or promote products derived from
-@rem this software without specific prior written permission.
-@rem
-@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-rmdir node_modules /S /Q \ No newline at end of file
diff --git a/tools/run_tests/pre_build_node.bat b/tools/run_tests/pre_build_node.bat
index 6e7cbe5d42..a29456f9ed 100644
--- a/tools/run_tests/pre_build_node.bat
+++ b/tools/run_tests/pre_build_node.bat
@@ -27,13 +27,8 @@
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-@rem Expire cache after 1 week
-npm update --cache-min 604800
+set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
-npm install node-gyp-install
-.\node_modules\.bin\node-gyp-install.cmd
+@rem Expire cache after 1 week
+call npm update --cache-min 604800
-@rem delete the redundant openssl headers
-for /f "delims=v" %%v in ('node --version') do (
- rmdir "%HOMEDRIVE%%HOMEPATH%\.node-gyp\%%v\include\node\openssl" /S /Q
-) \ No newline at end of file
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index df3ab90a83..86eb52bbde 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -60,6 +60,8 @@ _SKIP_COMPRESSION = ['large_compressed_unary',
_SKIP_ADVANCED = ['custom_metadata', 'status_code_and_message',
'unimplemented_method']
+_TEST_TIMEOUT = 3*60
+
class CXXLanguage:
def __init__(self):
@@ -459,7 +461,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name,
environ=environ,
shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language,
test_case),
- timeout_seconds=90,
+ timeout_seconds=_TEST_TIMEOUT,
flake_retries=5 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
kill_handler=_job_kill_handler)
@@ -495,7 +497,7 @@ def cloud_to_cloud_jobspec(language, test_case, server_name, server_host,
environ=environ,
shortname='cloud_to_cloud:%s:%s_server:%s' % (language, server_name,
test_case),
- timeout_seconds=90,
+ timeout_seconds=_TEST_TIMEOUT,
flake_retries=5 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0,
kill_handler=_job_kill_handler)
@@ -587,7 +589,11 @@ prod_servers = {
'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com',
False),
'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com',
- True)
+ True),
+ 'gateway_v4': ('grpc-test4.sandbox.googleapis.com',
+ 'grpc-test4.sandbox.googleapis.com', True),
+ 'cloud_gateway_v4': ('216.239.32.255', 'grpc-test4.sandbox.googleapis.com',
+ True),
}
argp = argparse.ArgumentParser(description='Run interop tests.')
diff --git a/tools/run_tests/run_node.bat b/tools/run_tests/run_node.bat
index 4177736356..0987fbee55 100644
--- a/tools/run_tests/run_node.bat
+++ b/tools/run_tests/run_node.bat
@@ -27,6 +27,7 @@
@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
set JUNIT_REPORT_PATH=src\node\report.xml
set JUNIT_REPORT_STACK=1
.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter --timeout 8000 src\node\test \ No newline at end of file
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh
index ffe9c12af1..d4b7250cbb 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/run_python.sh
@@ -40,9 +40,14 @@ export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
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
-tox
+if [ "$CONFIG" = "gcov" ]
+then
+ export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1
+ tox
+else
+ $ROOT/.tox/py27/bin/python $ROOT/setup.py test_lite
+fi
mkdir -p $ROOT/reports
rm -rf $ROOT/reports/python-coverage
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 08a5ff0e8f..99bf5df1f9 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -142,9 +142,8 @@ class CLanguage(object):
self._make_options = [_windows_toolset_option(self.args.compiler),
_windows_arch_option(self.args.arch)]
else:
- self._make_options = []
- self._docker_distro = self._get_docker_distro(self.args.use_docker,
- self.args.compiler)
+ self._docker_distro, self._make_options = self._compiler_options(self.args.use_docker,
+ self.args.compiler)
def test_specs(self):
out = []
@@ -229,18 +228,26 @@ class CLanguage(object):
def makefile_name(self):
return 'Makefile'
- def _get_docker_distro(self, use_docker, compiler):
+ def _clang_make_options(self):
+ return ['CC=clang', 'CXX=clang++', 'LD=clang', 'LDXX=clang++']
+
+ def _compiler_options(self, use_docker, compiler):
+ """Returns docker distro and make options to use for given compiler."""
if _is_use_docker_child():
- return "already_under_docker"
+ return ("already_under_docker", [])
if not use_docker:
_check_compiler(compiler, ['default'])
if compiler == 'gcc4.9' or compiler == 'default':
- return 'jessie'
+ return ('jessie', [])
elif compiler == 'gcc4.4':
- return 'squeeze'
+ return ('squeeze', [])
elif compiler == 'gcc5.3':
- return 'ubuntu1604'
+ return ('ubuntu1604', [])
+ elif compiler == 'clang3.4':
+ return ('ubuntu1404', self._clang_make_options())
+ elif compiler == 'clang3.6':
+ return ('ubuntu1604', self._clang_make_options())
else:
raise Exception('Compiler %s not supported.' % compiler)
@@ -290,10 +297,7 @@ class NodeLanguage(object):
return [['tools/run_tests/build_node.sh', self.node_version]]
def post_tests_steps(self):
- if self.platform == 'windows':
- return [['tools\\run_tests\\post_test_node.bat']]
- else:
- return []
+ return []
def makefile_name(self):
return 'Makefile'
@@ -353,15 +357,27 @@ class PythonLanguage(object):
_check_compiler(self.args.compiler, ['default'])
def test_specs(self):
+ # load list of known test suites
+ with open('src/python/grpcio/tests/tests.json') as tests_json_file:
+ tests_json = json.load(tests_json_file)
environment = dict(_FORCE_ENVIRON_FOR_WRAPPERS)
environment['PYVER'] = '2.7'
- return [self.config.job_spec(
- ['tools/run_tests/run_python.sh'],
- None,
- environ=environment,
- shortname='py.test',
- timeout_seconds=15*60
- )]
+ if self.config.build_config != 'gcov':
+ return [self.config.job_spec(
+ ['tools/run_tests/run_python.sh'],
+ None,
+ environ=dict(environment.items() +
+ [('GRPC_PYTHON_TESTRUNNER_FILTER', suite_name)]),
+ shortname='py.test.%s' % suite_name,
+ timeout_seconds=5*60)
+ for suite_name in tests_json]
+ else:
+ return [self.config.job_spec(['tools/run_tests/run_python.sh'],
+ None,
+ environ=environment,
+ shortname='py.test.coverage',
+ timeout_seconds=15*60)]
+
def pre_build_steps(self):
return []
@@ -765,6 +781,7 @@ argp.add_argument('--arch',
argp.add_argument('--compiler',
choices=['default',
'gcc4.4', 'gcc4.9', 'gcc5.3',
+ 'clang3.4', 'clang3.6',
'vs2010', 'vs2013', 'vs2015'],
default='default',
help='Selects compiler to use. Allowed values depend on the platform and language.')
@@ -852,10 +869,17 @@ if args.use_docker:
dockerfile_dirs = set([l.dockerfile_dir() for l in languages])
if len(dockerfile_dirs) > 1:
- print 'Languages to be tested require running under different docker images.'
- sys.exit(1)
- dockerfile_dir = next(iter(dockerfile_dirs))
-
+ if 'gcov' in args.config:
+ dockerfile_dir = 'tools/dockerfile/test/multilang_jessie_x64'
+ print ('Using multilang_jessie_x64 docker image for code coverage for '
+ 'all languages.')
+ else:
+ print ('Languages to be tested require running under different docker '
+ 'images.')
+ sys.exit(1)
+ else:
+ dockerfile_dir = next(iter(dockerfile_dirs))
+
child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ]
run_tests_cmd = 'python tools/run_tests/run_tests.py %s' % ' '.join(child_argv[1:])
diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml
index cffc180fb0..3840f4d8df 100644
--- a/tools/run_tests/sanity/sanity_tests.yaml
+++ b/tools/run_tests/sanity/sanity_tests.yaml
@@ -2,7 +2,6 @@
- script: tools/run_tests/sanity/check_cache_mk.sh
- script: tools/run_tests/sanity/check_sources_and_headers.py
- script: tools/run_tests/sanity/check_submodules.sh
-- script: tools/run_tests/sanity/check_version.py
- script: tools/buildgen/generate_projects.sh -j 3
cpu_cost: 3
- script: tools/distrib/check_copyright.py
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 0c7a6c7b5f..092ed35ad9 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -198,6 +198,38 @@
],
"headers": [],
"language": "c",
+ "name": "concurrent_connectivity_test",
+ "src": [
+ "test/core/surface/concurrent_connectivity_test.c"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "dns_resolver_connectivity_test",
+ "src": [
+ "test/core/client_config/resolvers/dns_resolver_connectivity_test.c"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
"name": "dns_resolver_test",
"src": [
"test/core/client_config/resolvers/dns_resolver_test.c"
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index d91245cd06..000315f2f4 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -266,6 +266,48 @@
"flaky": false,
"gtest": false,
"language": "c",
+ "name": "concurrent_connectivity_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
+ {
+ "args": [],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "cpu_cost": 0.1,
+ "exclude_configs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
+ "name": "dns_resolver_connectivity_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
+ {
+ "args": [],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
"name": "dns_resolver_test",
"platforms": [
"linux",