aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests')
-rw-r--r--tools/run_tests/README.md4
-rw-r--r--[-rwxr-xr-x]tools/run_tests/artifacts/__init__.py (renamed from tools/run_tests/prepare_travis.sh)41
-rw-r--r--tools/run_tests/artifacts/artifact_targets.py (renamed from tools/run_tests/artifact_targets.py)37
-rw-r--r--tools/run_tests/artifacts/build_artifact_csharp.bat (renamed from tools/run_tests/build_artifact_csharp.bat)0
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_csharp.sh (renamed from tools/run_tests/build_artifact_csharp.sh)2
-rw-r--r--tools/run_tests/artifacts/build_artifact_node.bat (renamed from tools/run_tests/build_artifact_node.bat)2
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_node.sh (renamed from tools/run_tests/build_artifact_node.sh)4
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_php.sh (renamed from tools/run_tests/build_artifact_php.sh)2
-rw-r--r--tools/run_tests/artifacts/build_artifact_protoc.bat (renamed from tools/run_tests/build_artifact_protoc.bat)2
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_protoc.sh (renamed from tools/run_tests/build_artifact_protoc.sh)2
-rw-r--r--tools/run_tests/artifacts/build_artifact_python.bat (renamed from tools/run_tests/build_artifact_python.bat)0
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_python.sh (renamed from tools/run_tests/build_artifact_python.sh)2
-rwxr-xr-xtools/run_tests/artifacts/build_artifact_ruby.sh (renamed from tools/run_tests/build_artifact_ruby.sh)2
-rwxr-xr-xtools/run_tests/artifacts/build_package_node.sh (renamed from tools/run_tests/build_package_node.sh)2
-rwxr-xr-xtools/run_tests/artifacts/build_package_php.sh (renamed from tools/run_tests/build_package_php.sh)2
-rwxr-xr-xtools/run_tests/artifacts/build_package_python.sh (renamed from tools/run_tests/build_package_python.sh)2
-rwxr-xr-xtools/run_tests/artifacts/build_package_ruby.sh (renamed from tools/run_tests/build_package_ruby.sh)2
-rw-r--r--tools/run_tests/artifacts/distribtest_targets.py (renamed from tools/run_tests/distribtest_targets.py)6
-rw-r--r--tools/run_tests/artifacts/package_targets.py (renamed from tools/run_tests/package_targets.py)15
-rw-r--r--tools/run_tests/build_stats/build_stats_schema.json (renamed from tools/run_tests/build_stats_schema.json)0
-rw-r--r--tools/run_tests/build_stats/build_stats_schema_no_matrix.json (renamed from tools/run_tests/build_stats_schema_no_matrix.json)0
-rwxr-xr-xtools/run_tests/dockerize/build_docker_and_run_tests.sh2
-rw-r--r--tools/run_tests/generated/configs.json (renamed from tools/run_tests/configs.json)0
-rw-r--r--tools/run_tests/generated/sources_and_headers.json (renamed from tools/run_tests/sources_and_headers.json)33
-rw-r--r--tools/run_tests/generated/tests.json (renamed from tools/run_tests/tests.json)0
-rwxr-xr-xtools/run_tests/helper_scripts/build_csharp.sh (renamed from tools/run_tests/build_csharp.sh)2
-rw-r--r--tools/run_tests/helper_scripts/build_csharp_coreclr.bat (renamed from tools/run_tests/build_csharp_coreclr.bat)2
-rwxr-xr-xtools/run_tests/helper_scripts/build_csharp_coreclr.sh (renamed from tools/run_tests/build_csharp_coreclr.sh)2
-rw-r--r--tools/run_tests/helper_scripts/build_node.bat (renamed from tools/run_tests/build_node.bat)0
-rwxr-xr-xtools/run_tests/helper_scripts/build_node.sh (renamed from tools/run_tests/build_node.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/build_php.sh (renamed from tools/run_tests/build_php.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/build_python.sh (renamed from tools/run_tests/build_python.sh)2
-rw-r--r--tools/run_tests/helper_scripts/build_python_msys2.sh (renamed from tools/run_tests/build_python_msys2.sh)0
-rwxr-xr-xtools/run_tests/helper_scripts/build_ruby.sh (renamed from tools/run_tests/build_ruby.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/post_tests_c.sh (renamed from tools/run_tests/post_tests_c.sh)2
-rw-r--r--tools/run_tests/helper_scripts/post_tests_csharp.bat (renamed from tools/run_tests/post_tests_csharp.bat)2
-rwxr-xr-xtools/run_tests/helper_scripts/post_tests_csharp.sh (renamed from tools/run_tests/post_tests_csharp.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/post_tests_php.sh (renamed from tools/run_tests/post_tests_php.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/post_tests_ruby.sh (renamed from tools/run_tests/post_tests_ruby.sh)2
-rw-r--r--tools/run_tests/helper_scripts/pre_build_c.bat (renamed from tools/run_tests/pre_build_c.bat)2
-rw-r--r--tools/run_tests/helper_scripts/pre_build_csharp.bat (renamed from tools/run_tests/pre_build_csharp.bat)2
-rwxr-xr-xtools/run_tests/helper_scripts/pre_build_csharp.sh (renamed from tools/run_tests/pre_build_csharp.sh)2
-rw-r--r--tools/run_tests/helper_scripts/pre_build_node.bat (renamed from tools/run_tests/pre_build_node.bat)0
-rwxr-xr-xtools/run_tests/helper_scripts/pre_build_node.sh (renamed from tools/run_tests/pre_build_node.sh)0
-rwxr-xr-xtools/run_tests/helper_scripts/pre_build_ruby.sh (renamed from tools/run_tests/pre_build_ruby.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/run_lcov.sh (renamed from tools/run_tests/run_lcov.sh)2
-rw-r--r--tools/run_tests/helper_scripts/run_node.bat (renamed from tools/run_tests/run_node.bat)0
-rwxr-xr-xtools/run_tests/helper_scripts/run_node.sh (renamed from tools/run_tests/run_node.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/run_python.sh (renamed from tools/run_tests/run_python.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/run_ruby.sh (renamed from tools/run_tests/run_ruby.sh)2
-rwxr-xr-xtools/run_tests/helper_scripts/run_tests_in_workspace.sh (renamed from tools/run_tests/run_tests_in_workspace.sh)2
-rw-r--r--tools/run_tests/interop/interop_html_report.template (renamed from tools/run_tests/interop_html_report.template)0
-rw-r--r--tools/run_tests/python_utils/__init__.py28
-rwxr-xr-xtools/run_tests/python_utils/antagonist.py (renamed from tools/run_tests/antagonist.py)0
-rwxr-xr-xtools/run_tests/python_utils/dockerjob.py (renamed from tools/run_tests/dockerjob.py)3
-rw-r--r--tools/run_tests/python_utils/filter_pull_request_tests.py (renamed from tools/run_tests/filter_pull_request_tests.py)0
-rwxr-xr-xtools/run_tests/python_utils/jobset.py (renamed from tools/run_tests/jobset.py)31
-rwxr-xr-xtools/run_tests/python_utils/port_server.py (renamed from tools/run_tests/port_server.py)0
-rw-r--r--tools/run_tests/python_utils/report_utils.py (renamed from tools/run_tests/report_utils.py)2
-rwxr-xr-xtools/run_tests/python_utils/watch_dirs.py (renamed from tools/run_tests/watch_dirs.py)0
-rwxr-xr-xtools/run_tests/run_interop_tests.py11
-rwxr-xr-xtools/run_tests/run_performance_tests.py8
-rwxr-xr-xtools/run_tests/run_stress_tests.py5
-rwxr-xr-xtools/run_tests/run_tests.py111
-rwxr-xr-xtools/run_tests/run_tests_matrix.py37
-rwxr-xr-xtools/run_tests/sanity/check_sources_and_headers.py2
-rwxr-xr-xtools/run_tests/sanity/check_submodules.sh9
-rwxr-xr-xtools/run_tests/sanity/check_test_filtering.py2
-rwxr-xr-xtools/run_tests/sanity/core_banned_functions.py60
-rw-r--r--tools/run_tests/sanity/sanity_tests.yaml2
-rwxr-xr-xtools/run_tests/task_runner.py9
71 files changed, 313 insertions, 213 deletions
diff --git a/tools/run_tests/README.md b/tools/run_tests/README.md
index dd727f4309..e709ddd2c0 100644
--- a/tools/run_tests/README.md
+++ b/tools/run_tests/README.md
@@ -22,6 +22,10 @@ The script is also capable of running interop tests for grpc-java and grpc-go, u
######Example
`tools/run_tests/run_interop_tests.py -l csharp -s c++ --use_docker` (run interop tests with C# client and C++ server)
+Note: if you see an error like `no space left on device` when running the
+interop tests using Docker, make sure that Docker is building the image files in
+a location with sufficient disk space.
+
#Performance benchmarks (run_performance_tests.py)
Runs predefined benchmark scenarios for given languages. Besides the simple configuration of running all the scenarios locally,
diff --git a/tools/run_tests/prepare_travis.sh b/tools/run_tests/artifacts/__init__.py
index 10546535e8..100a624dc9 100755..100644
--- a/tools/run_tests/prepare_travis.sh
+++ b/tools/run_tests/artifacts/__init__.py
@@ -1,5 +1,4 @@
-#!/bin/bash
-# Copyright 2015, Google Inc.
+# Copyright 2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -27,41 +26,3 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-cd `dirname $0`/../..
-grpc_dir=`pwd`
-
-distrib=`md5sum /etc/issue | cut -f1 -d\ `
-echo "Configuring for distribution $distrib"
-git submodule | while read sha path extra ; do
- cd /tmp
- name=`basename $path`
- file=$name-$sha-$CONFIG-prebuilt-$distrib.tar.gz
- echo -n "Looking for $file ..."
- url=http://storage.googleapis.com/grpc-prebuilt-packages/$file
- wget -q $url && (
- echo " Found."
- tar xfz $file
- ) || echo " Not found."
-done
-
-mkdir -p bins/$CONFIG/protobuf
-mkdir -p libs/$CONFIG/protobuf
-mkdir -p libs/$CONFIG/openssl
-
-function cpt {
- cp /tmp/prebuilt/$1 $2/$CONFIG/$3
- touch $2/$CONFIG/$3/`basename $1`
-}
-
-if [ -e /tmp/prebuilt/bin/protoc ] ; then
- touch third_party/protobuf/configure
- cpt bin/protoc bins protobuf
- cpt lib/libprotoc.a libs protobuf
- cpt lib/libprotobuf.a libs protobuf
-fi
-
-if [ -e /tmp/prebuilt/lib/libssl.a ] ; then
- cpt lib/libcrypto.a libs openssl
- cpt lib/libssl.a libs openssl
-fi
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py
index 65d34e17e1..005d99790a 100644
--- a/tools/run_tests/artifact_targets.py
+++ b/tools/run_tests/artifacts/artifact_targets.py
@@ -35,7 +35,8 @@ import random
import string
import sys
-import jobset
+sys.path.insert(0, os.path.abspath('..'))
+import python_utils.jobset as jobset
def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
@@ -113,7 +114,7 @@ class PythonArtifact:
environ['GRPC_BUILD_MANYLINUX_WHEEL'] = 'TRUE'
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_python_manylinux_%s' % self.arch,
- 'tools/run_tests/build_artifact_python.sh',
+ 'tools/run_tests/artifacts/build_artifact_python.sh',
environ=environ,
timeout_seconds=60*60)
elif self.platform == 'windows':
@@ -125,7 +126,7 @@ class PythonArtifact:
# seed. We create a random temp-dir here
dir = ''.join(random.choice(string.ascii_uppercase) for _ in range(10))
return create_jobspec(self.name,
- ['tools\\run_tests\\build_artifact_python.bat',
+ ['tools\\run_tests\\artifacts\\build_artifact_python.bat',
self.py_version,
'32' if self.arch == 'x86' else '64',
dir
@@ -136,7 +137,7 @@ class PythonArtifact:
environ['PYTHON'] = self.py_version
environ['SKIP_PIP_INSTALL'] = 'TRUE'
return create_jobspec(self.name,
- ['tools/run_tests/build_artifact_python.sh'],
+ ['tools/run_tests/artifacts/build_artifact_python.sh'],
environ=environ)
def __str__(self):
@@ -165,11 +166,11 @@ class RubyArtifact:
environ['SETARCH_CMD'] = 'linux32'
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_linux_%s' % self.arch,
- 'tools/run_tests/build_artifact_ruby.sh',
+ 'tools/run_tests/artifacts/build_artifact_ruby.sh',
environ=environ)
else:
return create_jobspec(self.name,
- ['tools/run_tests/build_artifact_ruby.sh'])
+ ['tools/run_tests/artifacts/build_artifact_ruby.sh'])
class CSharpExtArtifact:
@@ -184,7 +185,7 @@ class CSharpExtArtifact:
def pre_build_jobspecs(self):
if self.platform == 'windows':
return [create_jobspec('prebuild_%s' % self.name,
- ['tools\\run_tests\\pre_build_c.bat'],
+ ['tools\\run_tests\\helper_scripts\\pre_build_c.bat'],
shell=True,
flake_retries=5,
timeout_retries=2)]
@@ -195,7 +196,7 @@ class CSharpExtArtifact:
if self.platform == 'windows':
msbuild_platform = 'Win32' if self.arch == 'x86' else self.arch
return create_jobspec(self.name,
- ['tools\\run_tests\\build_artifact_csharp.bat',
+ ['tools\\run_tests\\artifacts\\build_artifact_csharp.bat',
'vsprojects\\grpc_csharp_ext.sln',
'/p:Configuration=Release',
'/p:PlatformToolset=v120',
@@ -210,14 +211,14 @@ class CSharpExtArtifact:
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/artifacts/build_artifact_csharp.sh',
environ=environ)
else:
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'],
+ ['tools/run_tests/artifacts/build_artifact_csharp.sh'],
environ=environ)
def __str__(self):
@@ -245,7 +246,7 @@ class NodeExtArtifact:
def build_jobspec(self):
if self.platform == 'windows':
return create_jobspec(self.name,
- ['tools\\run_tests\\build_artifact_node.bat',
+ ['tools\\run_tests\\artifacts\\build_artifact_node.bat',
self.gyp_arch],
shell=True)
else:
@@ -253,10 +254,10 @@ class NodeExtArtifact:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
- 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch))
+ 'tools/run_tests/artifacts/build_artifact_node.sh {}'.format(self.gyp_arch))
else:
return create_jobspec(self.name,
- ['tools/run_tests/build_artifact_node.sh',
+ ['tools/run_tests/artifacts/build_artifact_node.sh',
self.gyp_arch])
class PHPArtifact:
@@ -276,10 +277,10 @@ class PHPArtifact:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch),
- 'tools/run_tests/build_artifact_php.sh')
+ 'tools/run_tests/artifacts/build_artifact_php.sh')
else:
return create_jobspec(self.name,
- ['tools/run_tests/build_artifact_php.sh'])
+ ['tools/run_tests/artifacts/build_artifact_php.sh'])
class ProtocArtifact:
"""Builds protoc and protoc-plugin artifacts"""
@@ -306,18 +307,18 @@ class ProtocArtifact:
if self.platform == 'linux':
return create_docker_jobspec(self.name,
'tools/dockerfile/grpc_artifact_protoc',
- 'tools/run_tests/build_artifact_protoc.sh',
+ 'tools/run_tests/artifacts/build_artifact_protoc.sh',
environ=environ)
else:
environ['CXXFLAGS'] += ' -std=c++11 -stdlib=libc++ %s' % _MACOS_COMPAT_FLAG
return create_jobspec(self.name,
- ['tools/run_tests/build_artifact_protoc.sh'],
+ ['tools/run_tests/artifacts/build_artifact_protoc.sh'],
environ=environ)
else:
generator = 'Visual Studio 12 Win64' if self.arch == 'x64' else 'Visual Studio 12'
vcplatform = 'x64' if self.arch == 'x64' else 'Win32'
return create_jobspec(self.name,
- ['tools\\run_tests\\build_artifact_protoc.bat'],
+ ['tools\\run_tests\\artifacts\\build_artifact_protoc.bat'],
environ={'generator': generator,
'Platform': vcplatform})
diff --git a/tools/run_tests/build_artifact_csharp.bat b/tools/run_tests/artifacts/build_artifact_csharp.bat
index 24c8d485f9..24c8d485f9 100644
--- a/tools/run_tests/build_artifact_csharp.bat
+++ b/tools/run_tests/artifacts/build_artifact_csharp.bat
diff --git a/tools/run_tests/build_artifact_csharp.sh b/tools/run_tests/artifacts/build_artifact_csharp.sh
index 7438713f5c..aed04b2745 100755
--- a/tools/run_tests/build_artifact_csharp.sh
+++ b/tools/run_tests/artifacts/build_artifact_csharp.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
make grpc_csharp_ext
diff --git a/tools/run_tests/build_artifact_node.bat b/tools/run_tests/artifacts/build_artifact_node.bat
index 57d55ef19e..2e0ecd21d0 100644
--- a/tools/run_tests/build_artifact_node.bat
+++ b/tools/run_tests/artifacts/build_artifact_node.bat
@@ -27,7 +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 node_versions=0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0
+set node_versions=0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0 7.0.0
set PATH=%PATH%;C:\Program Files\nodejs\;%APPDATA%\npm
diff --git a/tools/run_tests/build_artifact_node.sh b/tools/run_tests/artifacts/build_artifact_node.sh
index 9d06472aa4..1066ebde19 100755
--- a/tools/run_tests/build_artifact_node.sh
+++ b/tools/run_tests/artifacts/build_artifact_node.sh
@@ -34,7 +34,7 @@ source ~/.nvm/nvm.sh
nvm use 4
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
rm -rf build || true
@@ -42,7 +42,7 @@ mkdir -p artifacts
npm update
-node_versions=( 0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0 )
+node_versions=( 0.12.0 1.0.0 1.1.0 2.0.0 3.0.0 4.0.0 5.0.0 6.0.0 7.0.0 )
for version in ${node_versions[@]}
do
diff --git a/tools/run_tests/build_artifact_php.sh b/tools/run_tests/artifacts/build_artifact_php.sh
index 669447fa9a..c8d55860c1 100755
--- a/tools/run_tests/build_artifact_php.sh
+++ b/tools/run_tests/artifacts/build_artifact_php.sh
@@ -31,7 +31,7 @@
PHP_TARGET_ARCH=$1
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
mkdir -p artifacts
diff --git a/tools/run_tests/build_artifact_protoc.bat b/tools/run_tests/artifacts/build_artifact_protoc.bat
index b2bf86da40..fd93318833 100644
--- a/tools/run_tests/build_artifact_protoc.bat
+++ b/tools/run_tests/artifacts/build_artifact_protoc.bat
@@ -34,7 +34,7 @@ cd third_party/protobuf/cmake
mkdir build & cd build
mkdir solution & cd solution
-cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF ../.. || goto :error
+cmake -G "%generator%" -Dprotobuf_BUILD_TESTS=OFF ../../.. || goto :error
endlocal
call vsprojects/build_plugins.bat || goto :error
diff --git a/tools/run_tests/build_artifact_protoc.sh b/tools/run_tests/artifacts/build_artifact_protoc.sh
index 161d3a84d6..26c2280eff 100755
--- a/tools/run_tests/build_artifact_protoc.sh
+++ b/tools/run_tests/artifacts/build_artifact_protoc.sh
@@ -33,7 +33,7 @@ source scl_source enable devtoolset-1.1
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
make plugins
diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/artifacts/build_artifact_python.bat
index 246713a6ce..246713a6ce 100644
--- a/tools/run_tests/build_artifact_python.bat
+++ b/tools/run_tests/artifacts/build_artifact_python.bat
diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/artifacts/build_artifact_python.sh
index 2a1d41fd68..5a5506029a 100755
--- a/tools/run_tests/build_artifact_python.sh
+++ b/tools/run_tests/artifacts/build_artifact_python.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
export GRPC_PYTHON_USE_CUSTOM_BDIST=0
export GRPC_PYTHON_BUILD_WITH_CYTHON=1
diff --git a/tools/run_tests/build_artifact_ruby.sh b/tools/run_tests/artifacts/build_artifact_ruby.sh
index 2d97b4068b..019efb01fd 100755
--- a/tools/run_tests/build_artifact_ruby.sh
+++ b/tools/run_tests/artifacts/build_artifact_ruby.sh
@@ -31,7 +31,7 @@ set -ex
SYSTEM=`uname | cut -f 1 -d_`
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
set +ex
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
diff --git a/tools/run_tests/build_package_node.sh b/tools/run_tests/artifacts/build_package_node.sh
index a5636cf87a..8b5e8c0bc1 100755
--- a/tools/run_tests/build_package_node.sh
+++ b/tools/run_tests/artifacts/build_package_node.sh
@@ -33,7 +33,7 @@ source ~/.nvm/nvm.sh
nvm use 4
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
base=$(pwd)
diff --git a/tools/run_tests/build_package_php.sh b/tools/run_tests/artifacts/build_package_php.sh
index 56e3319ed9..42a8d9f8df 100755
--- a/tools/run_tests/build_package_php.sh
+++ b/tools/run_tests/artifacts/build_package_php.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
mkdir -p artifacts/
cp -r $EXTERNAL_GIT_ROOT/architecture={x86,x64},language=php,platform={windows,linux,macos}/artifacts/* artifacts/ || true
diff --git a/tools/run_tests/build_package_python.sh b/tools/run_tests/artifacts/build_package_python.sh
index 2511a6ae46..4a1c15ceee 100755
--- a/tools/run_tests/build_package_python.sh
+++ b/tools/run_tests/artifacts/build_package_python.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
mkdir -p artifacts/
diff --git a/tools/run_tests/build_package_ruby.sh b/tools/run_tests/artifacts/build_package_ruby.sh
index 0a755bddb0..b4d20d8a4c 100755
--- a/tools/run_tests/build_package_ruby.sh
+++ b/tools/run_tests/artifacts/build_package_ruby.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
base=$(pwd)
diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py
index a16daac4fe..a7535b3852 100644
--- a/tools/run_tests/distribtest_targets.py
+++ b/tools/run_tests/artifacts/distribtest_targets.py
@@ -30,7 +30,11 @@
"""Definition of targets run distribution package tests."""
-import jobset
+import os.path
+import sys
+
+sys.path.insert(0, os.path.abspath('..'))
+import python_utils.jobset as jobset
def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
diff --git a/tools/run_tests/package_targets.py b/tools/run_tests/artifacts/package_targets.py
index 673affeac0..d490f571c3 100644
--- a/tools/run_tests/package_targets.py
+++ b/tools/run_tests/artifacts/package_targets.py
@@ -30,7 +30,12 @@
"""Definition of targets to build distribution packages."""
-import jobset
+import os.path
+import sys
+
+sys.path.insert(0, os.path.abspath('..'))
+import python_utils.jobset as jobset
+
def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
flake_retries=0, timeout_retries=0):
@@ -114,7 +119,7 @@ class NodePackage:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
- 'tools/run_tests/build_package_node.sh')
+ 'tools/run_tests/artifacts/build_package_node.sh')
class RubyPackage:
@@ -131,7 +136,7 @@ class RubyPackage:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
- 'tools/run_tests/build_package_ruby.sh')
+ 'tools/run_tests/artifacts/build_package_ruby.sh')
class PythonPackage:
@@ -148,7 +153,7 @@ class PythonPackage:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
- 'tools/run_tests/build_package_python.sh')
+ 'tools/run_tests/artifacts/build_package_python.sh')
class PHPPackage:
@@ -165,7 +170,7 @@ class PHPPackage:
return create_docker_jobspec(
self.name,
'tools/dockerfile/grpc_artifact_linux_x64',
- 'tools/run_tests/build_package_php.sh')
+ 'tools/run_tests/artifacts/build_package_php.sh')
def targets():
diff --git a/tools/run_tests/build_stats_schema.json b/tools/run_tests/build_stats/build_stats_schema.json
index 021a349545..021a349545 100644
--- a/tools/run_tests/build_stats_schema.json
+++ b/tools/run_tests/build_stats/build_stats_schema.json
diff --git a/tools/run_tests/build_stats_schema_no_matrix.json b/tools/run_tests/build_stats/build_stats_schema_no_matrix.json
index eeb067d7a5..eeb067d7a5 100644
--- a/tools/run_tests/build_stats_schema_no_matrix.json
+++ b/tools/run_tests/build_stats/build_stats_schema_no_matrix.json
diff --git a/tools/run_tests/dockerize/build_docker_and_run_tests.sh b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
index c3219c533d..b68ac89121 100755
--- a/tools/run_tests/dockerize/build_docker_and_run_tests.sh
+++ b/tools/run_tests/dockerize/build_docker_and_run_tests.sh
@@ -77,8 +77,6 @@ docker run \
-v /tmp/ccache:/tmp/ccache \
-v /tmp/npm-cache:/tmp/npm-cache \
-v /tmp/xdg-cache-home:/tmp/xdg-cache-home \
- -v /var/run/docker.sock:/var/run/docker.sock \
- -v $(which docker):/bin/docker \
-w /var/local/git/grpc \
--name=$CONTAINER_NAME \
$DOCKER_IMAGE_NAME \
diff --git a/tools/run_tests/configs.json b/tools/run_tests/generated/configs.json
index b0839ef026..b0839ef026 100644
--- a/tools/run_tests/configs.json
+++ b/tools/run_tests/generated/configs.json
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/generated/sources_and_headers.json
index 8b6c98a755..bd5b76ec1d 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/generated/sources_and_headers.json
@@ -6206,28 +6206,7 @@
},
{
"deps": [],
- "headers": [
- "third_party/benchmark/include/benchmark/benchmark.h",
- "third_party/benchmark/include/benchmark/benchmark_api.h",
- "third_party/benchmark/include/benchmark/macros.h",
- "third_party/benchmark/include/benchmark/reporter.h",
- "third_party/benchmark/src/arraysize.h",
- "third_party/benchmark/src/benchmark_api_internal.h",
- "third_party/benchmark/src/check.h",
- "third_party/benchmark/src/colorprint.h",
- "third_party/benchmark/src/commandlineflags.h",
- "third_party/benchmark/src/complexity.h",
- "third_party/benchmark/src/cycleclock.h",
- "third_party/benchmark/src/internal_macros.h",
- "third_party/benchmark/src/log.h",
- "third_party/benchmark/src/mutex.h",
- "third_party/benchmark/src/re.h",
- "third_party/benchmark/src/sleep.h",
- "third_party/benchmark/src/stat.h",
- "third_party/benchmark/src/string_util.h",
- "third_party/benchmark/src/sysinfo.h",
- "third_party/benchmark/src/timers.h"
- ],
+ "headers": [],
"is_filegroup": false,
"language": "c++",
"name": "benchmark",
@@ -6681,6 +6660,8 @@
"src/core/lib/channel/context.h",
"src/core/lib/channel/deadline_filter.h",
"src/core/lib/channel/handshaker.h",
+ "src/core/lib/channel/handshaker_factory.h",
+ "src/core/lib/channel/handshaker_registry.h",
"src/core/lib/channel/http_client_filter.h",
"src/core/lib/channel/http_server_filter.h",
"src/core/lib/channel/message_size_filter.h",
@@ -6747,6 +6728,7 @@
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
"src/core/lib/slice/percent_encoding.h",
+ "src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
@@ -6799,6 +6781,10 @@
"src/core/lib/channel/deadline_filter.h",
"src/core/lib/channel/handshaker.c",
"src/core/lib/channel/handshaker.h",
+ "src/core/lib/channel/handshaker_factory.c",
+ "src/core/lib/channel/handshaker_factory.h",
+ "src/core/lib/channel/handshaker_registry.c",
+ "src/core/lib/channel/handshaker_registry.h",
"src/core/lib/channel/http_client_filter.c",
"src/core/lib/channel/http_client_filter.h",
"src/core/lib/channel/http_server_filter.c",
@@ -6940,6 +6926,7 @@
"src/core/lib/slice/percent_encoding.h",
"src/core/lib/slice/slice.c",
"src/core/lib/slice/slice_buffer.c",
+ "src/core/lib/slice/slice_internal.h",
"src/core/lib/slice/slice_string_helpers.c",
"src/core/lib/slice/slice_string_helpers.h",
"src/core/lib/surface/alarm.c",
@@ -7068,6 +7055,7 @@
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
+ "include/grpc/impl/codegen/exec_ctx_fwd.h",
"include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h"
@@ -7079,6 +7067,7 @@
"include/grpc/impl/codegen/byte_buffer_reader.h",
"include/grpc/impl/codegen/compression_types.h",
"include/grpc/impl/codegen/connectivity_state.h",
+ "include/grpc/impl/codegen/exec_ctx_fwd.h",
"include/grpc/impl/codegen/grpc_types.h",
"include/grpc/impl/codegen/propagation_bits.h",
"include/grpc/impl/codegen/status.h"
diff --git a/tools/run_tests/tests.json b/tools/run_tests/generated/tests.json
index b76263b8b9..b76263b8b9 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/generated/tests.json
diff --git a/tools/run_tests/build_csharp.sh b/tools/run_tests/helper_scripts/build_csharp.sh
index 48ce11a10b..84c5b1c777 100755
--- a/tools/run_tests/build_csharp.sh
+++ b/tools/run_tests/helper_scripts/build_csharp.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../../src/csharp
+cd $(dirname $0)/../../../src/csharp
# overriding NativeDependenciesConfigurationUnix is needed to make gcov code coverage work.
xbuild /p:Configuration=$MSBUILD_CONFIG /p:NativeDependenciesConfigurationUnix=$CONFIG Grpc.sln
diff --git a/tools/run_tests/build_csharp_coreclr.bat b/tools/run_tests/helper_scripts/build_csharp_coreclr.bat
index b6e3ccbd2b..78e5f5998b 100644
--- a/tools/run_tests/build_csharp_coreclr.bat
+++ b/tools/run_tests/helper_scripts/build_csharp_coreclr.bat
@@ -29,7 +29,7 @@
setlocal
-cd /d %~dp0\..\..\src\csharp
+cd /d %~dp0\..\..\..\src\csharp
dotnet restore . || goto :error
diff --git a/tools/run_tests/build_csharp_coreclr.sh b/tools/run_tests/helper_scripts/build_csharp_coreclr.sh
index 02cf0d39cb..dd5fd31c75 100755
--- a/tools/run_tests/build_csharp_coreclr.sh
+++ b/tools/run_tests/helper_scripts/build_csharp_coreclr.sh
@@ -30,7 +30,7 @@
set -ex
-cd $(dirname $0)/../../src/csharp
+cd $(dirname $0)/../../../src/csharp
# TODO(jtattermusch): introduce caching
dotnet restore .
diff --git a/tools/run_tests/build_node.bat b/tools/run_tests/helper_scripts/build_node.bat
index 82e8208348..82e8208348 100644
--- a/tools/run_tests/build_node.bat
+++ b/tools/run_tests/helper_scripts/build_node.bat
diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/helper_scripts/build_node.sh
index d9292fd8aa..8a928bb762 100755
--- a/tools/run_tests/build_node.sh
+++ b/tools/run_tests/helper_scripts/build_node.sh
@@ -38,6 +38,6 @@ set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
npm install --unsafe-perm --build-from-source
diff --git a/tools/run_tests/build_php.sh b/tools/run_tests/helper_scripts/build_php.sh
index 77a8abcfe7..acaaa23adf 100755
--- a/tools/run_tests/build_php.sh
+++ b/tools/run_tests/helper_scripts/build_php.sh
@@ -33,7 +33,7 @@ set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
root=`pwd`
export GRPC_LIB_SUBDIR=libs/$CONFIG
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/helper_scripts/build_python.sh
index 7cac394960..0e88e96765 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/helper_scripts/build_python.sh
@@ -31,7 +31,7 @@
set -ex
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
##########################
# Portability operations #
diff --git a/tools/run_tests/build_python_msys2.sh b/tools/run_tests/helper_scripts/build_python_msys2.sh
index 6e9d369018..6e9d369018 100644
--- a/tools/run_tests/build_python_msys2.sh
+++ b/tools/run_tests/helper_scripts/build_python_msys2.sh
diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/helper_scripts/build_ruby.sh
index 10343fce69..32638dede9 100755
--- a/tools/run_tests/build_ruby.sh
+++ b/tools/run_tests/helper_scripts/build_ruby.sh
@@ -34,7 +34,7 @@ set -ex
export GRPC_CONFIG=${CONFIG:-opt}
# change to grpc's ruby directory
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
rm -rf ./tmp
rake compile
diff --git a/tools/run_tests/post_tests_c.sh b/tools/run_tests/helper_scripts/post_tests_c.sh
index 4409526dab..a83a59e23b 100755
--- a/tools/run_tests/post_tests_c.sh
+++ b/tools/run_tests/helper_scripts/post_tests_c.sh
@@ -32,7 +32,7 @@ set -ex
if [ "$CONFIG" != "gcov" ] ; then exit ; fi
-root=$(readlink -f $(dirname $0)/../..)
+root=$(readlink -f $(dirname $0)/../../..)
out=$root/reports/c_cxx_coverage
tmp1=$(mktemp)
tmp2=$(mktemp)
diff --git a/tools/run_tests/post_tests_csharp.bat b/tools/run_tests/helper_scripts/post_tests_csharp.bat
index 0d49a00b2a..2359f148ce 100644
--- a/tools/run_tests/post_tests_csharp.bat
+++ b/tools/run_tests/helper_scripts/post_tests_csharp.bat
@@ -36,7 +36,7 @@ if not "%CONFIG%" == "gcov" (
)
@rem enter src/csharp directory
-cd /d %~dp0\..\..\src\csharp
+cd /d %~dp0\..\..\..\src\csharp
@rem Generate code coverage report
@rem TODO(jtattermusch): currently the report list is hardcoded
diff --git a/tools/run_tests/post_tests_csharp.sh b/tools/run_tests/helper_scripts/post_tests_csharp.sh
index bb6f5c6e18..762c1f8827 100755
--- a/tools/run_tests/post_tests_csharp.sh
+++ b/tools/run_tests/helper_scripts/post_tests_csharp.sh
@@ -33,7 +33,7 @@ set -ex
if [ "$CONFIG" != "gcov" ] ; then exit ; fi
# change to gRPC repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
# Generate the csharp extension coverage report
gcov objs/gcov/src/csharp/ext/*.o
diff --git a/tools/run_tests/post_tests_php.sh b/tools/run_tests/helper_scripts/post_tests_php.sh
index b4098066ea..23dc202322 100755
--- a/tools/run_tests/post_tests_php.sh
+++ b/tools/run_tests/helper_scripts/post_tests_php.sh
@@ -32,7 +32,7 @@ set -ex
if [ "$CONFIG" != "gcov" ] ; then exit ; fi
-root=$(readlink -f $(dirname $0)/../..)
+root=$(readlink -f $(dirname $0)/../../..)
out=$root/reports/php_ext_coverage
tmp1=$(mktemp)
tmp2=$(mktemp)
diff --git a/tools/run_tests/post_tests_ruby.sh b/tools/run_tests/helper_scripts/post_tests_ruby.sh
index 0877e44805..300edfe8a3 100755
--- a/tools/run_tests/post_tests_ruby.sh
+++ b/tools/run_tests/helper_scripts/post_tests_ruby.sh
@@ -32,7 +32,7 @@ set -ex
if [ "$CONFIG" != "gcov" ] ; then exit ; fi
-root=$(readlink -f $(dirname $0)/../..)
+root=$(readlink -f $(dirname $0)/../../..)
out=$root/reports/ruby_ext_coverage
tmp1=$(mktemp)
tmp2=$(mktemp)
diff --git a/tools/run_tests/pre_build_c.bat b/tools/run_tests/helper_scripts/pre_build_c.bat
index e4ab69384c..75b90f85b2 100644
--- a/tools/run_tests/pre_build_c.bat
+++ b/tools/run_tests/helper_scripts/pre_build_c.bat
@@ -32,7 +32,7 @@
setlocal
@rem enter repo root
-cd /d %~dp0\..\..
+cd /d %~dp0\..\..\..
@rem Location of nuget.exe
set NUGET=C:\nuget\nuget.exe
diff --git a/tools/run_tests/pre_build_csharp.bat b/tools/run_tests/helper_scripts/pre_build_csharp.bat
index f15979a96b..139955d4da 100644
--- a/tools/run_tests/pre_build_csharp.bat
+++ b/tools/run_tests/helper_scripts/pre_build_csharp.bat
@@ -32,7 +32,7 @@
setlocal
@rem enter repo root
-cd /d %~dp0\..\..
+cd /d %~dp0\..\..\..
@rem Location of nuget.exe
set NUGET=C:\nuget\nuget.exe
diff --git a/tools/run_tests/pre_build_csharp.sh b/tools/run_tests/helper_scripts/pre_build_csharp.sh
index ee678ddce5..1f808556f4 100755
--- a/tools/run_tests/pre_build_csharp.sh
+++ b/tools/run_tests/helper_scripts/pre_build_csharp.sh
@@ -31,7 +31,7 @@
set -ex
# cd to gRPC csharp directory
-cd $(dirname $0)/../../src/csharp
+cd $(dirname $0)/../../../src/csharp
root=`pwd`
diff --git a/tools/run_tests/pre_build_node.bat b/tools/run_tests/helper_scripts/pre_build_node.bat
index addb01a2a4..addb01a2a4 100644
--- a/tools/run_tests/pre_build_node.bat
+++ b/tools/run_tests/helper_scripts/pre_build_node.bat
diff --git a/tools/run_tests/pre_build_node.sh b/tools/run_tests/helper_scripts/pre_build_node.sh
index e63be9da52..e63be9da52 100755
--- a/tools/run_tests/pre_build_node.sh
+++ b/tools/run_tests/helper_scripts/pre_build_node.sh
diff --git a/tools/run_tests/pre_build_ruby.sh b/tools/run_tests/helper_scripts/pre_build_ruby.sh
index e7074c45c2..56b58df544 100755
--- a/tools/run_tests/pre_build_ruby.sh
+++ b/tools/run_tests/helper_scripts/pre_build_ruby.sh
@@ -34,6 +34,6 @@ set -ex
export GRPC_CONFIG=${CONFIG:-opt}
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
bundle install
diff --git a/tools/run_tests/run_lcov.sh b/tools/run_tests/helper_scripts/run_lcov.sh
index 796a0b5ceb..bc7b44cd3e 100755
--- a/tools/run_tests/run_lcov.sh
+++ b/tools/run_tests/helper_scripts/run_lcov.sh
@@ -32,7 +32,7 @@ set -ex
out=$(readlink -f ${1:-coverage})
-root=$(readlink -f $(dirname $0)/../..)
+root=$(readlink -f $(dirname $0)/../../..)
shift || true
tmp=$(mktemp)
cd $root
diff --git a/tools/run_tests/run_node.bat b/tools/run_tests/helper_scripts/run_node.bat
index 0987fbee55..0987fbee55 100644
--- a/tools/run_tests/run_node.bat
+++ b/tools/run_tests/helper_scripts/run_node.bat
diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/helper_scripts/run_node.sh
index 44f75645f5..0fafe9481a 100755
--- a/tools/run_tests/run_node.sh
+++ b/tools/run_tests/helper_scripts/run_node.sh
@@ -37,7 +37,7 @@ set -ex
CONFIG=${CONFIG:-opt}
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
root=`pwd`
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/helper_scripts/run_python.sh
index 17e0186f2a..7be473428f 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/helper_scripts/run_python.sh
@@ -31,7 +31,7 @@
set -ex
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
PYTHON=`realpath -s "${1:-py27/bin/python}"`
diff --git a/tools/run_tests/run_ruby.sh b/tools/run_tests/helper_scripts/run_ruby.sh
index 73a84ac361..ab153b7e25 100755
--- a/tools/run_tests/run_ruby.sh
+++ b/tools/run_tests/helper_scripts/run_ruby.sh
@@ -31,6 +31,6 @@
set -ex
# change to grpc repo root
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
rake
diff --git a/tools/run_tests/run_tests_in_workspace.sh b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
index 9c6c5b76e0..002c8d6de2 100755
--- a/tools/run_tests/run_tests_in_workspace.sh
+++ b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh
@@ -34,7 +34,7 @@
# newly created workspace)
set -ex
-cd $(dirname $0)/../..
+cd $(dirname $0)/../../..
export repo_root=$(pwd)
rm -rf "${WORKSPACE_NAME}"
diff --git a/tools/run_tests/interop_html_report.template b/tools/run_tests/interop/interop_html_report.template
index 46cce426b7..46cce426b7 100644
--- a/tools/run_tests/interop_html_report.template
+++ b/tools/run_tests/interop/interop_html_report.template
diff --git a/tools/run_tests/python_utils/__init__.py b/tools/run_tests/python_utils/__init__.py
new file mode 100644
index 0000000000..100a624dc9
--- /dev/null
+++ b/tools/run_tests/python_utils/__init__.py
@@ -0,0 +1,28 @@
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/tools/run_tests/antagonist.py b/tools/run_tests/python_utils/antagonist.py
index 857addfb38..857addfb38 100755
--- a/tools/run_tests/antagonist.py
+++ b/tools/run_tests/python_utils/antagonist.py
diff --git a/tools/run_tests/dockerjob.py b/tools/run_tests/python_utils/dockerjob.py
index 4a7e61b3c4..0869c5cee9 100755
--- a/tools/run_tests/dockerjob.py
+++ b/tools/run_tests/python_utils/dockerjob.py
@@ -31,13 +31,14 @@
from __future__ import print_function
-import jobset
import tempfile
import time
import uuid
import os
import subprocess
+import jobset
+
_DEVNULL = open(os.devnull, 'w')
diff --git a/tools/run_tests/filter_pull_request_tests.py b/tools/run_tests/python_utils/filter_pull_request_tests.py
index ca1d6d4eb5..ca1d6d4eb5 100644
--- a/tools/run_tests/filter_pull_request_tests.py
+++ b/tools/run_tests/python_utils/filter_pull_request_tests.py
diff --git a/tools/run_tests/jobset.py b/tools/run_tests/python_utils/jobset.py
index 1b5d6d66a0..7b2c62d1a2 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/python_utils/jobset.py
@@ -219,7 +219,8 @@ class JobResult(object):
class Job(object):
"""Manages one job."""
- def __init__(self, spec, newline_on_success, travis, add_env):
+ def __init__(self, spec, newline_on_success, travis, add_env,
+ quiet_success=False):
self._spec = spec
self._newline_on_success = newline_on_success
self._travis = travis
@@ -227,7 +228,9 @@ class Job(object):
self._retries = 0
self._timeout_retries = 0
self._suppress_failure_message = False
- message('START', spec.shortname, do_newline=self._travis)
+ self._quiet_success = quiet_success
+ if not self._quiet_success:
+ message('START', spec.shortname, do_newline=self._travis)
self.result = JobResult()
self.start()
@@ -302,10 +305,11 @@ class Job(object):
if real > 0.5:
cores = (user + sys) / real
measurement = '; cpu_cost=%.01f; estimated=%.01f' % (cores, self._spec.cpu_cost)
- message('PASSED', '%s [time=%.1fsec; retries=%d:%d%s]' % (
- self._spec.shortname, elapsed, self._retries, self._timeout_retries, measurement),
- stdout() if self._spec.verbose_success else None,
- do_newline=self._newline_on_success or self._travis)
+ if not self._quiet_success:
+ message('PASSED', '%s [time=%.1fsec; retries=%d:%d%s]' % (
+ self._spec.shortname, elapsed, self._retries, self._timeout_retries, measurement),
+ stdout() if self._spec.verbose_success else None,
+ do_newline=self._newline_on_success or self._travis)
self.result.state = 'PASSED'
elif (self._state == _RUNNING and
self._spec.timeout_seconds is not None and
@@ -341,7 +345,7 @@ class Jobset(object):
"""Manages one run of jobs."""
def __init__(self, check_cancelled, maxjobs, newline_on_success, travis,
- stop_on_failure, add_env):
+ stop_on_failure, add_env, quiet_success):
self._running = set()
self._check_cancelled = check_cancelled
self._cancelled = False
@@ -352,6 +356,7 @@ class Jobset(object):
self._travis = travis
self._stop_on_failure = stop_on_failure
self._add_env = add_env
+ self._quiet_success = quiet_success
self.resultset = {}
self._remaining = None
self._start_time = time.time()
@@ -380,7 +385,8 @@ class Jobset(object):
job = Job(spec,
self._newline_on_success,
self._travis,
- self._add_env)
+ self._add_env,
+ self._quiet_success)
self._running.add(job)
if job.GetSpec().shortname not in self.resultset:
self.resultset[job.GetSpec().shortname] = []
@@ -403,7 +409,8 @@ class Jobset(object):
break
for job in dead:
self._completed += 1
- self.resultset[job.GetSpec().shortname].append(job.result)
+ if not self._quiet_success or job.result.state != 'PASSED':
+ self.resultset[job.GetSpec().shortname].append(job.result)
self._running.remove(job)
if dead: return
if not self._travis and platform_string() != 'windows':
@@ -463,7 +470,8 @@ def run(cmdlines,
infinite_runs=False,
stop_on_failure=False,
add_env={},
- skip_jobs=False):
+ skip_jobs=False,
+ quiet_success=False):
if skip_jobs:
results = {}
skipped_job_result = JobResult()
@@ -474,7 +482,8 @@ def run(cmdlines,
return results
js = Jobset(check_cancelled,
maxjobs if maxjobs is not None else _DEFAULT_MAX_JOBS,
- newline_on_success, travis, stop_on_failure, add_env)
+ newline_on_success, travis, stop_on_failure, add_env,
+ quiet_success)
for cmdline, remaining in tag_remaining(cmdlines):
if not js.start(cmdline):
break
diff --git a/tools/run_tests/port_server.py b/tools/run_tests/python_utils/port_server.py
index e9b3f7ff79..e9b3f7ff79 100755
--- a/tools/run_tests/port_server.py
+++ b/tools/run_tests/python_utils/port_server.py
diff --git a/tools/run_tests/report_utils.py b/tools/run_tests/python_utils/report_utils.py
index 5ce2a87cfa..352cf7abe7 100644
--- a/tools/run_tests/report_utils.py
+++ b/tools/run_tests/python_utils/report_utils.py
@@ -84,7 +84,7 @@ def render_interop_html_report(
client_langs, server_langs, test_cases, auth_test_cases, http2_cases,
resultset, num_failures, cloud_to_prod, prod_servers, http2_interop):
"""Generate HTML report for interop tests."""
- template_file = 'tools/run_tests/interop_html_report.template'
+ template_file = 'tools/run_tests/interop/interop_html_report.template'
try:
mytemplate = Template(filename=template_file, format_exceptions=True)
except NameError:
diff --git a/tools/run_tests/watch_dirs.py b/tools/run_tests/python_utils/watch_dirs.py
index 21ef23e158..21ef23e158 100755
--- a/tools/run_tests/watch_dirs.py
+++ b/tools/run_tests/python_utils/watch_dirs.py
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index 83cfc429f9..981e38b813 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -34,20 +34,21 @@ from __future__ import print_function
import argparse
import atexit
-import dockerjob
import itertools
-import jobset
import json
import multiprocessing
import os
import re
-import report_utils
import subprocess
import sys
import tempfile
import time
import uuid
+import python_utils.dockerjob as dockerjob
+import python_utils.jobset as jobset
+import python_utils.report_utils as report_utils
+
# Docker doesn't clean up after itself, so we do it on exit.
atexit.register(lambda: subprocess.call(['stty', 'echo']))
@@ -178,10 +179,10 @@ class JavaLanguage:
return {}
def unimplemented_test_cases(self):
- return _SKIP_ADVANCED + _SKIP_COMPRESSION
+ return _SKIP_COMPRESSION
def unimplemented_test_cases_server(self):
- return _SKIP_ADVANCED + _SKIP_COMPRESSION
+ return _SKIP_COMPRESSION
def __str__(self):
return 'java'
diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py
index 69ccff85cf..b7b742d7af 100755
--- a/tools/run_tests/run_performance_tests.py
+++ b/tools/run_tests/run_performance_tests.py
@@ -35,21 +35,21 @@ from __future__ import print_function
import argparse
import collections
import itertools
-import jobset
import json
import multiprocessing
import os
-import performance.scenario_config as scenario_config
import pipes
import re
-import report_utils
import subprocess
import sys
import tempfile
import time
import traceback
import uuid
-import report_utils
+
+import performance.scenario_config as scenario_config
+import python_utils.jobset as jobset
+import python_utils.report_utils as report_utils
_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
diff --git a/tools/run_tests/run_stress_tests.py b/tools/run_tests/run_stress_tests.py
index de4a22877c..a94a615b88 100755
--- a/tools/run_tests/run_stress_tests.py
+++ b/tools/run_tests/run_stress_tests.py
@@ -33,9 +33,7 @@ from __future__ import print_function
import argparse
import atexit
-import dockerjob
import itertools
-import jobset
import json
import multiprocessing
import os
@@ -46,6 +44,9 @@ import tempfile
import time
import uuid
+import python_utils.dockerjob as dockerjob
+import python_utils.jobset as jobset
+
# Docker doesn't clean up after itself, so we do it on exit.
atexit.register(lambda: subprocess.call(['stty', 'echo']))
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index c49ee4a6cc..924274191e 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -54,9 +54,9 @@ import time
from six.moves import urllib
import uuid
-import jobset
-import report_utils
-import watch_dirs
+import python_utils.jobset as jobset
+import python_utils.report_utils as report_utils
+import python_utils.watch_dirs as watch_dirs
_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
@@ -116,7 +116,7 @@ class Config(object):
def get_c_tests(travis, test_lang) :
out = []
platforms_str = 'ci_platforms' if travis else 'platforms'
- with open('tools/run_tests/tests.json') as f:
+ with open('tools/run_tests/generated/tests.json') as f:
js = json.load(f)
return [tgt
for tgt in js
@@ -300,7 +300,7 @@ class CLanguage(object):
def pre_build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\pre_build_c.bat']]
+ return [['tools\\run_tests\\helper_scripts\\pre_build_c.bat']]
else:
return []
@@ -311,7 +311,7 @@ class CLanguage(object):
if self.platform == 'windows':
return []
else:
- return [['tools/run_tests/post_tests_c.sh']]
+ return [['tools/run_tests/helper_scripts/post_tests_c.sh']]
def makefile_name(self):
return 'Makefile'
@@ -382,17 +382,16 @@ class NodeLanguage(object):
def test_specs(self):
if self.platform == 'windows':
- return [self.config.job_spec(['tools\\run_tests\\run_node.bat'], None)]
+ return [self.config.job_spec(['tools\\run_tests\\helper_scripts\\run_node.bat'])]
else:
- return [self.config.job_spec(['tools/run_tests/run_node.sh', self.node_version],
- None,
+ return [self.config.job_spec(['tools/run_tests/helper_scripts/run_node.sh', self.node_version],
environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def pre_build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\pre_build_node.bat']]
+ return [['tools\\run_tests\\helper_scripts\\pre_build_node.bat']]
else:
- return [['tools/run_tests/pre_build_node.sh', self.node_version]]
+ return [['tools/run_tests/helper_scripts/pre_build_node.sh', self.node_version]]
def make_targets(self):
return []
@@ -402,9 +401,9 @@ class NodeLanguage(object):
def build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\build_node.bat']]
+ return [['tools\\run_tests\\helper_scripts\\build_node.bat']]
else:
- return [['tools/run_tests/build_node.sh', self.node_version]]
+ return [['tools/run_tests/helper_scripts/build_node.sh', self.node_version]]
def post_tests_steps(self):
return []
@@ -427,7 +426,7 @@ class PhpLanguage(object):
_check_compiler(self.args.compiler, ['default'])
def test_specs(self):
- return [self.config.job_spec(['src/php/bin/run_tests.sh'], None,
+ return [self.config.job_spec(['src/php/bin/run_tests.sh'],
environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def pre_build_steps(self):
@@ -440,10 +439,10 @@ class PhpLanguage(object):
return []
def build_steps(self):
- return [['tools/run_tests/build_php.sh']]
+ return [['tools/run_tests/helper_scripts/build_php.sh']]
def post_tests_steps(self):
- return [['tools/run_tests/post_tests_php.sh']]
+ return [['tools/run_tests/helper_scripts/post_tests_php.sh']]
def makefile_name(self):
return 'Makefile'
@@ -463,7 +462,7 @@ class Php7Language(object):
_check_compiler(self.args.compiler, ['default'])
def test_specs(self):
- return [self.config.job_spec(['src/php/bin/run_tests.sh'], None,
+ return [self.config.job_spec(['src/php/bin/run_tests.sh'],
environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def pre_build_steps(self):
@@ -476,10 +475,10 @@ class Php7Language(object):
return []
def build_steps(self):
- return [['tools/run_tests/build_php.sh']]
+ return [['tools/run_tests/helper_scripts/build_php.sh']]
def post_tests_steps(self):
- return [['tools/run_tests/post_tests_php.sh']]
+ return [['tools/run_tests/helper_scripts/post_tests_php.sh']]
def makefile_name(self):
return 'Makefile'
@@ -548,18 +547,18 @@ class PythonLanguage(object):
if os.name == 'nt':
shell = ['bash']
- builder = [os.path.abspath('tools/run_tests/build_python_msys2.sh')]
+ builder = [os.path.abspath('tools/run_tests/helper_scripts/build_python_msys2.sh')]
builder_prefix_arguments = ['MINGW{}'.format(bits)]
venv_relative_python = ['Scripts/python.exe']
toolchain = ['mingw32']
else:
shell = []
- builder = [os.path.abspath('tools/run_tests/build_python.sh')]
+ builder = [os.path.abspath('tools/run_tests/helper_scripts/build_python.sh')]
builder_prefix_arguments = []
venv_relative_python = ['bin/python']
toolchain = ['unix']
- runner = [os.path.abspath('tools/run_tests/run_python.sh')]
+ runner = [os.path.abspath('tools/run_tests/helper_scripts/run_python.sh')]
config_vars = _PythonConfigVars(shell, builder, builder_prefix_arguments,
venv_relative_python, toolchain, runner)
python27_config = _python_config_generator(name='py27', major='2',
@@ -611,12 +610,12 @@ class RubyLanguage(object):
_check_compiler(self.args.compiler, ['default'])
def test_specs(self):
- return [self.config.job_spec(['tools/run_tests/run_ruby.sh'],
+ return [self.config.job_spec(['tools/run_tests/helper_scripts/run_ruby.sh'],
timeout_seconds=10*60,
environ=_FORCE_ENVIRON_FOR_WRAPPERS)]
def pre_build_steps(self):
- return [['tools/run_tests/pre_build_ruby.sh']]
+ return [['tools/run_tests/helper_scripts/pre_build_ruby.sh']]
def make_targets(self):
return []
@@ -625,10 +624,10 @@ class RubyLanguage(object):
return []
def build_steps(self):
- return [['tools/run_tests/build_ruby.sh']]
+ return [['tools/run_tests/helper_scripts/build_ruby.sh']]
def post_tests_steps(self):
- return [['tools/run_tests/post_tests_ruby.sh']]
+ return [['tools/run_tests/helper_scripts/post_tests_ruby.sh']]
def makefile_name(self):
return 'Makefile'
@@ -702,7 +701,6 @@ class CSharpLanguage(object):
for test in tests_by_assembly[assembly]:
cmdline = runtime_cmd + [assembly_file, '--test=%s' % test] + nunit_args
specs.append(self.config.job_spec(cmdline,
- None,
shortname='csharp.%s' % test,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
else:
@@ -720,7 +718,6 @@ class CSharpLanguage(object):
# to prevent problems with registering the profiler.
run_exclusive = 1000000
specs.append(self.config.job_spec(cmdline,
- None,
shortname='csharp.coverage.%s' % assembly,
cpu_cost=run_exclusive,
environ=_FORCE_ENVIRON_FOR_WRAPPERS))
@@ -728,9 +725,9 @@ class CSharpLanguage(object):
def pre_build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\pre_build_csharp.bat']]
+ return [['tools\\run_tests\\helper_scripts\\pre_build_csharp.bat']]
else:
- return [['tools/run_tests/pre_build_csharp.sh']]
+ return [['tools/run_tests/helper_scripts/pre_build_csharp.sh']]
def make_targets(self):
return ['grpc_csharp_ext']
@@ -741,22 +738,22 @@ class CSharpLanguage(object):
def build_steps(self):
if self.args.compiler == 'coreclr':
if self.platform == 'windows':
- return [['tools\\run_tests\\build_csharp_coreclr.bat']]
+ return [['tools\\run_tests\\helper_scripts\\build_csharp_coreclr.bat']]
else:
- return [['tools/run_tests/build_csharp_coreclr.sh']]
+ return [['tools/run_tests/helper_scripts/build_csharp_coreclr.sh']]
else:
if self.platform == 'windows':
return [[_windows_build_bat(self.args.compiler),
'src/csharp/Grpc.sln',
'/p:Configuration=%s' % _MSBUILD_CONFIG[self.config.build_config]]]
else:
- return [['tools/run_tests/build_csharp.sh']]
+ return [['tools/run_tests/helper_scripts/build_csharp.sh']]
def post_tests_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\post_tests_csharp.bat']]
+ return [['tools\\run_tests\\helper_scripts\\post_tests_csharp.bat']]
else:
- return [['tools/run_tests/post_tests_csharp.sh']]
+ return [['tools/run_tests/helper_scripts/post_tests_csharp.sh']]
def makefile_name(self):
return 'Makefile'
@@ -779,7 +776,7 @@ class ObjCLanguage(object):
def test_specs(self):
return [
self.config.job_spec(['src/objective-c/tests/run_tests.sh'],
- timeout_seconds=None,
+ timeout_seconds=60*60,
shortname='objc-tests',
environ=_FORCE_ENVIRON_FOR_WRAPPERS),
self.config.job_spec(['src/objective-c/tests/build_example_test.sh'],
@@ -823,8 +820,12 @@ class Sanity(object):
def test_specs(self):
import yaml
with open('tools/run_tests/sanity/sanity_tests.yaml', 'r') as f:
+ environ={'TEST': 'true'}
+ if _is_use_docker_child():
+ environ['CLANG_FORMAT_SKIP_DOCKER'] = 'true'
return [self.config.job_spec(cmd['script'].split(),
- timeout_seconds=None, environ={'TEST': 'true'},
+ timeout_seconds=30*60,
+ environ=environ,
cpu_cost=cmd.get('cpu_cost', 1))
for cmd in yaml.load(f)]
@@ -875,9 +876,9 @@ class NodeExpressLanguage(object):
def pre_build_steps(self):
if self.platform == 'windows':
- return [['tools\\run_tests\\pre_build_node.bat']]
+ return [['tools\\run_tests\\helper_scripts\\pre_build_node.bat']]
else:
- return [['tools/run_tests/pre_build_node.sh', self.node_version]]
+ return [['tools/run_tests/helper_scripts/pre_build_node.sh', self.node_version]]
def make_targets(self):
return []
@@ -901,7 +902,7 @@ class NodeExpressLanguage(object):
return 'node_express'
# different configurations we can run under
-with open('tools/run_tests/configs.json') as f:
+with open('tools/run_tests/generated/configs.json') as f:
_CONFIGS = dict((cfg['config'], Config(**cfg)) for cfg in ast.literal_eval(f.read()))
@@ -1097,6 +1098,12 @@ argp.add_argument('-x', '--xml_report', default=None, type=str,
help='Generates a JUnit-compatible XML report')
argp.add_argument('--report_suite_name', default='tests', type=str,
help='Test suite name to use in generated JUnit XML report')
+argp.add_argument('--quiet_success',
+ default=False,
+ action='store_const',
+ const=True,
+ help='Dont print anything when a test passes. Passing tests also will not be reported in XML report. ' +
+ 'Useful when running many iterations of each test (argument -n).')
argp.add_argument('--force_default_poller', default=False, action='store_const', const=True,
help='Dont try to iterate over many polling strategies when they exist')
args = argp.parse_args()
@@ -1296,7 +1303,7 @@ def _start_port_server(port_server_port):
running = False
if running:
current_version = int(subprocess.check_output(
- [sys.executable, os.path.abspath('tools/run_tests/port_server.py'),
+ [sys.executable, os.path.abspath('tools/run_tests/python_utils/port_server.py'),
'dump_version']))
print('my port server is version %d' % current_version)
running = (version >= current_version)
@@ -1308,7 +1315,7 @@ def _start_port_server(port_server_port):
fd, logfile = tempfile.mkstemp()
os.close(fd)
print('starting port_server, with log file %s' % logfile)
- args = [sys.executable, os.path.abspath('tools/run_tests/port_server.py'),
+ args = [sys.executable, os.path.abspath('tools/run_tests/python_utils/port_server.py'),
'-p', '%d' % port_server_port, '-l', logfile]
env = dict(os.environ)
env['BUILD_ID'] = 'pleaseDontKillMeJenkins'
@@ -1414,7 +1421,7 @@ def _build_and_run(
return []
# start antagonists
- antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py'])
+ antagonists = [subprocess.Popen(['tools/run_tests/python_utils/antagonist.py'])
for _ in range(0, args.antagonists)]
port_server_port = 32766
_start_port_server(port_server_port)
@@ -1444,20 +1451,24 @@ def _build_and_run(
else itertools.repeat(massaged_one_run, runs_per_test))
all_runs = itertools.chain.from_iterable(runs_sequence)
+ if args.quiet_success:
+ jobset.message('START', 'Running tests quietly, only failing tests will be reported', do_newline=True)
num_test_failures, resultset = jobset.run(
all_runs, check_cancelled, newline_on_success=newline_on_success,
travis=args.travis, infinite_runs=infinite_runs, maxjobs=args.jobs,
stop_on_failure=args.stop_on_failure,
- add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port})
+ add_env={'GRPC_TEST_PORT_SERVER': 'localhost:%d' % port_server_port},
+ quiet_success=args.quiet_success)
if resultset:
for k, v in sorted(resultset.items()):
num_runs, num_failures = _calculate_num_runs_failures(v)
- if num_failures == num_runs: # what about infinite_runs???
- jobset.message('FAILED', k, do_newline=True)
- elif num_failures > 0:
- jobset.message(
- 'FLAKE', '%s [%d/%d runs flaked]' % (k, num_failures, num_runs),
- do_newline=True)
+ if num_failures > 0:
+ if num_failures == num_runs: # what about infinite_runs???
+ jobset.message('FAILED', k, do_newline=True)
+ else:
+ jobset.message(
+ 'FLAKE', '%s [%d/%d runs flaked]' % (k, num_failures, num_runs),
+ do_newline=True)
finally:
for antagonist in antagonists:
antagonist.kill()
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index 989bc7eb21..6e83180c66 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -31,12 +31,13 @@
"""Run test matrix."""
import argparse
-import jobset
import multiprocessing
import os
-import report_utils
import sys
-from filter_pull_request_tests import filter_tests
+
+import python_utils.jobset as jobset
+import python_utils.report_utils as report_utils
+from python_utils.filter_pull_request_tests import filter_tests
_ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..'))
os.chdir(_ROOT)
@@ -69,7 +70,7 @@ def _workspace_jobspec(name, runtests_args=[], workspace_name=None, inner_jobs=_
workspace_name = 'workspace_%s' % name
env = {'WORKSPACE_NAME': workspace_name}
test_job = jobset.JobSpec(
- cmdline=['tools/run_tests/run_tests_in_workspace.sh',
+ cmdline=['tools/run_tests/helper_scripts/run_tests_in_workspace.sh',
'-t',
'-j', str(inner_jobs),
'-x', '../report_%s.xml' % name,
@@ -242,6 +243,17 @@ def _allowed_labels():
return sorted(all_labels)
+def _runs_per_test_type(arg_str):
+ """Auxiliary function to parse the "runs_per_test" flag."""
+ try:
+ n = int(arg_str)
+ if n <= 0: raise ValueError
+ return n
+ except:
+ msg = '\'{}\' is not a positive integer'.format(arg_str)
+ raise argparse.ArgumentTypeError(msg)
+
+
if __name__ == "__main__":
argp = argparse.ArgumentParser(description='Run a matrix of run_tests.py tests.')
argp.add_argument('-j', '--jobs',
@@ -253,6 +265,11 @@ if __name__ == "__main__":
nargs='+',
default=[],
help='Filter targets to run by label with AND semantics.')
+ argp.add_argument('--exclude',
+ choices=_allowed_labels(),
+ nargs='+',
+ default=[],
+ help='Exclude targets with any of given labels.')
argp.add_argument('--build_only',
default=False,
action='store_const',
@@ -269,7 +286,7 @@ if __name__ == "__main__":
default=False,
action='store_const',
const=True,
- help='Filters out tests irrelavant to pull request changes.')
+ help='Filters out tests irrelevant to pull request changes.')
argp.add_argument('--base_branch',
default='origin/master',
type=str,
@@ -278,6 +295,9 @@ if __name__ == "__main__":
default=_DEFAULT_INNER_JOBS,
type=int,
help='Number of jobs in each run_tests.py instance')
+ argp.add_argument('-n', '--runs_per_test', default=1, type=_runs_per_test_type,
+ help='How many times to run each tests. >1 runs implies ' +
+ 'omitting passing test from the output & reports.')
args = argp.parse_args()
extra_args = []
@@ -285,6 +305,10 @@ if __name__ == "__main__":
extra_args.append('--build_only')
if args.force_default_poller:
extra_args.append('--force_default_poller')
+ if args.runs_per_test > 1:
+ extra_args.append('-n')
+ extra_args.append('%s' % args.runs_per_test)
+ extra_args.append('--quiet_success')
all_jobs = _create_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs) + \
_create_portability_test_jobs(extra_args=extra_args, inner_jobs=args.inner_jobs)
@@ -292,7 +316,8 @@ if __name__ == "__main__":
jobs = []
for job in all_jobs:
if not args.filter or all(filter in job.labels for filter in args.filter):
- jobs.append(job)
+ if not any(exclude_label in job.labels for exclude_label in args.exclude):
+ jobs.append(job)
if not jobs:
jobset.message('FAILED', 'No test suites match given criteria.',
diff --git a/tools/run_tests/sanity/check_sources_and_headers.py b/tools/run_tests/sanity/check_sources_and_headers.py
index b733ba173f..a86db02b80 100755
--- a/tools/run_tests/sanity/check_sources_and_headers.py
+++ b/tools/run_tests/sanity/check_sources_and_headers.py
@@ -34,7 +34,7 @@ import re
import sys
root = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
-with open(os.path.join(root, 'tools', 'run_tests', 'sources_and_headers.json')) as f:
+with open(os.path.join(root, 'tools', 'run_tests', 'generated', 'sources_and_headers.json')) as f:
js = json.loads(f.read())
re_inc1 = re.compile(r'^#\s*include\s*"([^"]*)"')
diff --git a/tools/run_tests/sanity/check_submodules.sh b/tools/run_tests/sanity/check_submodules.sh
index be12f968d2..61e8185854 100755
--- a/tools/run_tests/sanity/check_submodules.sh
+++ b/tools/run_tests/sanity/check_submodules.sh
@@ -41,13 +41,14 @@ want_submodules=`mktemp /tmp/submXXXXXX`
git submodule | awk '{ print $1 }' | sort > $submodules
cat << EOF | awk '{ print $1 }' | sort > $want_submodules
- c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9 third_party/boringssl (version_for_cocoapods_2.0-100-gc880e42)
- 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f)
44c25c892a6229b20db7cd9dc05584ea865896de third_party/benchmark (v0.1.0-343-g44c25c8)
+ c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9 third_party/boringssl (c880e42)
+ 886e7d75368e3f4fab3f4d0d3584e4abfc557755 third_party/boringssl-with-bazel (version_for_cocoapods_7.0-857-g886e7d7)
+ 05b155ff59114735ec8cd089f669c4c3d8f59029 third_party/gflags (v2.1.0-45-g05b155f)
c99458533a9b4c743ed51537e25989ea55944908 third_party/googletest (release-1.7.0)
- a428e42072765993ff674fda72863c9f1aa2d268 third_party/protobuf (v3.1.0)
+ a428e42072765993ff674fda72863c9f1aa2d268 third_party/protobuf (v3.1.0-alpha-1)
+ bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c third_party/thrift (bcad917)
50893291621658f355bc5b4d450a8d06a563053d third_party/zlib (v1.2.8)
- bcad91771b7f0bff28a1cac1981d7ef2b9bcef3c third_party/thrift
EOF
diff -u $submodules $want_submodules
diff --git a/tools/run_tests/sanity/check_test_filtering.py b/tools/run_tests/sanity/check_test_filtering.py
index b522cdeb49..290a6e2ddf 100755
--- a/tools/run_tests/sanity/check_test_filtering.py
+++ b/tools/run_tests/sanity/check_test_filtering.py
@@ -38,7 +38,7 @@ import re
# hack import paths to pick up extra code
sys.path.insert(0, os.path.abspath('tools/run_tests/'))
from run_tests_matrix import _create_test_jobs, _create_portability_test_jobs
-import filter_pull_request_tests
+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_PLATFORM_LABELS = ['linux', 'macos', 'windows']
diff --git a/tools/run_tests/sanity/core_banned_functions.py b/tools/run_tests/sanity/core_banned_functions.py
new file mode 100755
index 0000000000..afac10bf80
--- /dev/null
+++ b/tools/run_tests/sanity/core_banned_functions.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python2.7
+
+# Copyright 2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import sys
+
+os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
+
+# map of banned function signature to whitelist
+BANNED_EXCEPT = {
+ 'grpc_resource_quota_ref(': ['src/core/lib/iomgr/resource_quota.c'],
+ 'grpc_resource_quota_unref(': ['src/core/lib/iomgr/resource_quota.c'],
+ 'grpc_slice_buffer_destroy(': ['src/core/lib/slice/slice_buffer.c'],
+ 'grpc_slice_buffer_reset_and_unref(': ['src/core/lib/slice/slice_buffer.c'],
+ 'grpc_slice_ref(': ['src/core/lib/slice/slice.c'],
+ 'grpc_slice_unref(': ['src/core/lib/slice/slice.c'],
+}
+
+errors = 0
+for root, dirs, files in os.walk('src/core'):
+ for filename in files:
+ path = os.path.join(root, filename)
+ if os.path.splitext(path)[1] != '.c': continue
+ with open(path) as f:
+ text = f.read()
+ for banned, exceptions in BANNED_EXCEPT.items():
+ if path in exceptions: continue
+ if banned in text:
+ print 'Illegal use of "%s" in %s' % (banned, path)
+ errors += 1
+
+assert errors == 0
diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml
index 32e62dd529..37819166e3 100644
--- a/tools/run_tests/sanity/sanity_tests.yaml
+++ b/tools/run_tests/sanity/sanity_tests.yaml
@@ -3,6 +3,7 @@
- script: tools/run_tests/sanity/check_sources_and_headers.py
- script: tools/run_tests/sanity/check_submodules.sh
- script: tools/run_tests/sanity/check_test_filtering.py
+- script: tools/run_tests/sanity/core_banned_functions.py
- script: tools/buildgen/generate_projects.sh -j 3
cpu_cost: 3
- script: tools/distrib/check_copyright.py
@@ -12,3 +13,4 @@
- script: tools/distrib/check_nanopb_output.sh
- script: tools/distrib/check_include_guards.py
- script: tools/distrib/python/check_grpcio_tools.py
+
diff --git a/tools/run_tests/task_runner.py b/tools/run_tests/task_runner.py
index 2e3fa443b9..fdc4668222 100755
--- a/tools/run_tests/task_runner.py
+++ b/tools/run_tests/task_runner.py
@@ -33,14 +33,13 @@
from __future__ import print_function
import argparse
-import atexit
-import jobset
import multiprocessing
import sys
-import artifact_targets
-import distribtest_targets
-import package_targets
+import artifacts.artifact_targets as artifact_targets
+import artifacts.distribtest_targets as distribtest_targets
+import artifacts.package_targets as package_targets
+import python_utils.jobset as jobset
_TARGETS = []
_TARGETS += artifact_targets.targets()