aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/codegen/core/gen_hpack_tables.c13
-rw-r--r--tools/codegen/core/gen_legal_metadata_characters.c7
-rwxr-xr-xtools/jenkins/build_docker_and_run_tests.sh7
-rwxr-xr-xtools/jenkins/build_interop_image.sh14
-rwxr-xr-xtools/jenkins/docker_run_tests.sh4
-rwxr-xr-xtools/jenkins/grpc_interop_csharp/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_cxx/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_go/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_java/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_node/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_php/build_interop.sh3
-rwxr-xr-xtools/jenkins/grpc_interop_ruby/build_interop.sh3
-rw-r--r--tools/jenkins/grpc_jenkins_slave/Dockerfile5
-rwxr-xr-xtools/run_tests/build_node.sh5
-rwxr-xr-xtools/run_tests/build_python.sh49
-rwxr-xr-xtools/run_tests/port_server.py19
-rwxr-xr-xtools/run_tests/run_interop_tests.py65
-rwxr-xr-xtools/run_tests/run_node.sh12
-rwxr-xr-xtools/run_tests/run_python.sh2
-rwxr-xr-xtools/run_tests/run_tests.py69
20 files changed, 190 insertions, 102 deletions
diff --git a/tools/codegen/core/gen_hpack_tables.c b/tools/codegen/core/gen_hpack_tables.c
index d924aba602..bae4e4cd73 100644
--- a/tools/codegen/core/gen_hpack_tables.c
+++ b/tools/codegen/core/gen_hpack_tables.c
@@ -71,7 +71,11 @@ static unsigned char prefix_mask(unsigned char prefix_len) {
unsigned char i;
unsigned char out = 0;
for (i = 0; i < prefix_len; i++) {
- out |= (unsigned char)(1 << (7 - i));
+ /* NB: the following integer arithmetic operation needs to be in its
+ * expanded form due to the "integral promotion" performed (see section
+ * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
+ * is then required to avoid the compiler warning */
+ out = (unsigned char)(out | (unsigned char)(1 << (7 - i)));
}
return out;
}
@@ -92,7 +96,12 @@ static void generate_first_byte_lut(void) {
chrspec = NULL;
for (j = 0; j < num_fields; j++) {
if ((prefix_mask(fields[j].prefix_length) & i) == fields[j].prefix) {
- suffix = suffix_mask(fields[j].prefix_length) & (unsigned char)i;
+ /* NB: the following integer arithmetic operation needs to be in its
+ * expanded form due to the "integral promotion" performed (see section
+ * 3.2.1.1 of the C89 draft standard). A cast to the smaller container
+ * type is then required to avoid the compiler warning */
+ suffix = (unsigned char)(suffix_mask(fields[j].prefix_length) &
+ (unsigned char)i);
if (suffix == suffix_mask(fields[j].prefix_length)) {
if (fields[j].index != 2) continue;
} else if (suffix == 0) {
diff --git a/tools/codegen/core/gen_legal_metadata_characters.c b/tools/codegen/core/gen_legal_metadata_characters.c
index 2ffda54a21..677fa5c155 100644
--- a/tools/codegen/core/gen_legal_metadata_characters.c
+++ b/tools/codegen/core/gen_legal_metadata_characters.c
@@ -41,7 +41,12 @@ static unsigned char legal_bits[256 / 8];
static void legal(int x) {
int byte = x / 8;
int bit = x % 8;
- legal_bits[byte] |= (unsigned char)(1 << bit);
+ /* NB: the following integer arithmetic operation needs to be in its
+ * expanded form due to the "integral promotion" performed (see section
+ * 3.2.1.1 of the C89 draft standard). A cast to the smaller container type
+ * is then required to avoid the compiler warning */
+ legal_bits[byte] =
+ (unsigned char)((legal_bits[byte] | (unsigned char)(1 << bit)));
}
static void dump(void) {
diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh
index 2c562e992a..8b7809f2e2 100755
--- a/tools/jenkins/build_docker_and_run_tests.sh
+++ b/tools/jenkins/build_docker_and_run_tests.sh
@@ -37,8 +37,13 @@ cd `dirname $0`/../..
git_root=`pwd`
cd -
+# Ensure existence of ccache directory
mkdir -p /tmp/ccache
+# Ensure existence of the home directory for XDG caches (e.g. what pip uses for
+# its cache location now that --download-cache is deprecated).
+mkdir -p /tmp/xdg-cache-home
+
# Create a local branch so the child Docker script won't complain
git branch -f jenkins-docker
@@ -57,9 +62,11 @@ docker run \
-e "config=$config" \
-e "arch=$arch" \
-e CCACHE_DIR=/tmp/ccache \
+ -e XDG_CACHE_HOME=/tmp/xdg-cache-home \
-i $TTY_FLAG \
-v "$git_root:/var/local/jenkins/grpc" \
-v /tmp/ccache:/tmp/ccache \
+ -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 \
diff --git a/tools/jenkins/build_interop_image.sh b/tools/jenkins/build_interop_image.sh
index b5958588f2..3664eed84d 100755
--- a/tools/jenkins/build_interop_image.sh
+++ b/tools/jenkins/build_interop_image.sh
@@ -35,12 +35,12 @@ set -x
cd `dirname $0`/../..
GRPC_ROOT=`pwd`
-MOUNT_ARGS="-v $GRPC_ROOT:/var/local/jenkins/grpc"
+MOUNT_ARGS="-v $GRPC_ROOT:/var/local/jenkins/grpc:ro"
GRPC_JAVA_ROOT=`cd ../grpc-java && pwd`
if [ "$GRPC_JAVA_ROOT" != "" ]
then
- MOUNT_ARGS+=" -v $GRPC_JAVA_ROOT:/var/local/jenkins/grpc-java"
+ MOUNT_ARGS+=" -v $GRPC_JAVA_ROOT:/var/local/jenkins/grpc-java:ro"
else
echo "WARNING: grpc-java not found, it won't be mounted to the docker container."
fi
@@ -48,7 +48,7 @@ fi
GRPC_GO_ROOT=`cd ../grpc-go && pwd`
if [ "$GRPC_GO_ROOT" != "" ]
then
- MOUNT_ARGS+=" -v $GRPC_GO_ROOT:/var/local/jenkins/grpc-go"
+ MOUNT_ARGS+=" -v $GRPC_GO_ROOT:/var/local/jenkins/grpc-go:ro"
else
echo "WARNING: grpc-go not found, it won't be mounted to the docker container."
fi
@@ -60,6 +60,14 @@ mkdir -p /tmp/ccache
# BASE_NAME - base name used to locate the base Dockerfile and build script
# TTY_FLAG - optional -t flag to make docker allocate tty.
+# Mount service account dir if available.
+# If service_directory does not contain the service account JSON file,
+# some of the tests will fail.
+if [ -e $HOME/service_account ]
+then
+ MOUNT_ARGS+=" -v $HOME/service_account:/var/local/jenkins/service_account:ro"
+fi
+
# Use image name based on Dockerfile checksum
BASE_IMAGE=${BASE_NAME}_base:`sha1sum tools/jenkins/$BASE_NAME/Dockerfile | cut -f1 -d\ `
diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh
index 2e39bc6f51..8bafeea620 100755
--- a/tools/jenkins/docker_run_tests.sh
+++ b/tools/jenkins/docker_run_tests.sh
@@ -36,6 +36,10 @@ set -e
export CONFIG=$config
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.5
+# Ensure that programs depending on current-user-ownership of cache directories
+# are satisfied (it's being mounted from outside the image).
+chown `whoami` $XDG_CACHE_HOME
+
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
diff --git a/tools/jenkins/grpc_interop_csharp/build_interop.sh b/tools/jenkins/grpc_interop_csharp/build_interop.sh
index e91cbed81e..8fde687900 100755
--- a/tools/jenkins/grpc_interop_csharp/build_interop.sh
+++ b/tools/jenkins/grpc_interop_csharp/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc
make install-certs
diff --git a/tools/jenkins/grpc_interop_cxx/build_interop.sh b/tools/jenkins/grpc_interop_cxx/build_interop.sh
index 4163e11ecc..1c0828d23a 100755
--- a/tools/jenkins/grpc_interop_cxx/build_interop.sh
+++ b/tools/jenkins/grpc_interop_cxx/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc
make install-certs
diff --git a/tools/jenkins/grpc_interop_go/build_interop.sh b/tools/jenkins/grpc_interop_go/build_interop.sh
index 78dd4ea9cf..05fc6dfdfb 100755
--- a/tools/jenkins/grpc_interop_go/build_interop.sh
+++ b/tools/jenkins/grpc_interop_go/build_interop.sh
@@ -36,6 +36,9 @@ set -e
# to test instead of using "go get" to download from Github directly.
git clone --recursive /var/local/jenkins/grpc-go src/gooogle.golang.org/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
# Get dependencies from GitHub
# NOTE: once grpc-go dependencies change, this needs to be updated manually
# but we don't expect this to happen any time soon.
diff --git a/tools/jenkins/grpc_interop_java/build_interop.sh b/tools/jenkins/grpc_interop_java/build_interop.sh
index 4ee2f44e3d..9997c63308 100755
--- a/tools/jenkins/grpc_interop_java/build_interop.sh
+++ b/tools/jenkins/grpc_interop_java/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc-java
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc-java
./gradlew :grpc-interop-testing:installDist -PskipCodegen=true
diff --git a/tools/jenkins/grpc_interop_node/build_interop.sh b/tools/jenkins/grpc_interop_node/build_interop.sh
index 55e2a4081b..84e25e3308 100755
--- a/tools/jenkins/grpc_interop_node/build_interop.sh
+++ b/tools/jenkins/grpc_interop_node/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc
nvm use 0.12
nvm alias default 0.12 # prevent the need to run 'nvm use' in every shell
diff --git a/tools/jenkins/grpc_interop_php/build_interop.sh b/tools/jenkins/grpc_interop_php/build_interop.sh
index 745dea845d..cd9d67804a 100755
--- a/tools/jenkins/grpc_interop_php/build_interop.sh
+++ b/tools/jenkins/grpc_interop_php/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc
rvm --default use ruby-2.1
diff --git a/tools/jenkins/grpc_interop_ruby/build_interop.sh b/tools/jenkins/grpc_interop_ruby/build_interop.sh
index 7d407e7d0a..c5023f5c1d 100755
--- a/tools/jenkins/grpc_interop_ruby/build_interop.sh
+++ b/tools/jenkins/grpc_interop_ruby/build_interop.sh
@@ -34,6 +34,9 @@ set -e
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
+# copy service account keys if available
+cp -r /var/local/jenkins/service_account $HOME || true
+
cd /var/local/git/grpc
rvm --default use ruby-2.1
diff --git a/tools/jenkins/grpc_jenkins_slave/Dockerfile b/tools/jenkins/grpc_jenkins_slave/Dockerfile
index 4f5387eeb5..5f2b425c8c 100644
--- a/tools/jenkins/grpc_jenkins_slave/Dockerfile
+++ b/tools/jenkins/grpc_jenkins_slave/Dockerfile
@@ -126,10 +126,11 @@ RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
RUN apt-get update && apt-get install -y \
python-all-dev \
python3-all-dev \
- python-pip \
- python-virtualenv
+ python-pip
# Install Python packages from PyPI
+RUN pip install pip --upgrade
+RUN pip install virtualenv
RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.0.0a2
# For sanity test
diff --git a/tools/run_tests/build_node.sh b/tools/run_tests/build_node.sh
index 95ffb94c6e..faa7b624b8 100755
--- a/tools/run_tests/build_node.sh
+++ b/tools/run_tests/build_node.sh
@@ -36,9 +36,4 @@ CONFIG=${CONFIG:-opt}
# change to grpc repo root
cd $(dirname $0)/../..
-export CXXFLAGS=-I`pwd`/include
-export LDFLAGS=-L`pwd`/libs/$CONFIG
-
-cd src/node
-
npm install --unsafe-perm
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh
index 2efc2c714d..24cf6ba7c8 100755
--- a/tools/run_tests/build_python.sh
+++ b/tools/run_tests/build_python.sh
@@ -39,6 +39,33 @@ GRPCIO=$ROOT/src/python/grpcio
GRPCIO_TEST=$ROOT/src/python/grpcio_test
GRPCIO_HEALTH_CHECKING=$ROOT/src/python/grpcio_health_checking
+install_grpcio_deps() {
+ cd $GRPCIO
+ pip install -r requirements.txt
+}
+install_grpcio_test_deps() {
+ cd $GRPCIO_TEST
+ pip install -r requirements.txt
+}
+
+install_grpcio() {
+ CFLAGS="-I$ROOT/include -std=c89" LDFLAGS=-L$ROOT/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install $GRPCIO
+}
+install_grpcio_test() {
+ pip install $GRPCIO_TEST
+}
+install_grpcio_health_checking() {
+ pip install $GRPCIO_HEALTH_CHECKING
+}
+
+# Cleans the environment of previous installations
+clean_grpcio_all() {
+ (yes | pip uninstall grpcio) || true
+ (yes | pip uninstall grpcio_test) || true
+ (yes | pip uninstall grpcio_health_checking) || true
+}
+
+# Builds the testing environment.
make_virtualenv() {
virtualenv_name="python"$1"_virtual_environment"
if [ ! -d $virtualenv_name ]
@@ -48,33 +75,29 @@ make_virtualenv() {
source $virtualenv_name/bin/activate
# Install grpcio
- cd $GRPCIO
- pip install -r requirements.txt
- CFLAGS="-I$ROOT/include -std=c89" LDFLAGS=-L$ROOT/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install $GRPCIO
+ install_grpcio_deps
+ install_grpcio
# Install grpcio_test
- cd $GRPCIO_TEST
- pip install -r requirements.txt
- pip install $GRPCIO_TEST
+ install_grpcio_test_deps
+ install_grpcio_test
# Install grpcio_health_checking
- pip install $GRPCIO_HEALTH_CHECKING
+ install_grpcio_health_checking
else
source $virtualenv_name/bin/activate
# Uninstall and re-install the packages we care about. Don't use
# --force-reinstall or --ignore-installed to avoid propagating this
# unnecessarily to dependencies. Don't use --no-deps to avoid missing
# dependency upgrades.
- (yes | pip uninstall grpcio) || true
- (yes | pip uninstall grpcio_test) || true
- (yes | pip uninstall grpcio_health_checking) || true
- (CFLAGS="-I$ROOT/include -std=c89" LDFLAGS=-L$ROOT/libs/$CONFIG GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install $GRPCIO) || (
+ clean_grpcio_all
+ install_grpcio || (
# Fall back to rebuilding the entire environment
rm -rf $virtualenv_name
make_virtualenv $1
)
- pip install $GRPCIO_TEST
- pip install $GRPCIO_HEALTH_CHECKING
+ install_grpcio_test
+ install_grpcio_health_checking
fi
}
diff --git a/tools/run_tests/port_server.py b/tools/run_tests/port_server.py
index 48b6214b95..b953df952c 100755
--- a/tools/run_tests/port_server.py
+++ b/tools/run_tests/port_server.py
@@ -38,6 +38,18 @@ import socket
import sys
import time
+
+# increment this number whenever making a change to ensure that
+# the changes are picked up by running CI servers
+# note that all changes must be backwards compatible
+_MY_VERSION = 2
+
+
+if len(sys.argv) == 2 and sys.argv[1] == 'dump_version':
+ print _MY_VERSION
+ sys.exit(0)
+
+
argp = argparse.ArgumentParser(description='Server for httpcli_test')
argp.add_argument('-p', '--port', default=12345, type=int)
args = argp.parse_args()
@@ -47,9 +59,6 @@ print 'port server running on port %d' % args.port
pool = []
in_use = {}
-with open(__file__) as f:
- _MY_VERSION = hashlib.sha1(f.read()).hexdigest()
-
def refill_pool(max_timeout, req):
"""Scan for ports not marked for being in use"""
@@ -113,7 +122,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
del in_use[p]
pool.append(p)
self.log_message('drop port %d' % p)
- elif self.path == '/version':
+ elif self.path == '/version_number':
# fetch a version string and the current process pid
self.send_response(200)
self.send_header('Content-Type', 'text/plain')
@@ -128,7 +137,7 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
self.end_headers()
now = time.time()
self.wfile.write(yaml.dump({'pool': pool, 'in_use': dict((k, now - v) for k, v in in_use.iteritems())}))
- elif self.path == '/quit':
+ elif self.path == '/quitquitquit':
self.send_response(200)
self.end_headers()
keep_running = False
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index f0935fb5d6..48c34f6871 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -82,7 +82,7 @@ class CXXLanguage:
['--use_tls=true'])
def cloud_to_prod_env(self):
- return None
+ return {}
def server_args(self):
return ['bins/opt/interop_server', '--use_tls=true']
@@ -132,7 +132,7 @@ class JavaLanguage:
['--use_tls=true', '--use_test_ca=true'])
def cloud_to_prod_env(self):
- return None
+ return {}
def server_args(self):
return ['./run-test-server.sh', '--use_tls=true']
@@ -158,7 +158,7 @@ class GoLanguage:
['--use_tls=true'])
def cloud_to_prod_env(self):
- return None
+ return {}
def server_args(self):
return ['go', 'run', 'server.go', '--use_tls=true']
@@ -250,8 +250,7 @@ _LANGUAGES = {
}
# languages supported as cloud_to_cloud servers
-# TODO(jtattermusch): enable other languages as servers as well
-_SERVERS = ['c++', 'node', 'csharp', 'java', 'go']
+_SERVERS = ['c++', 'node', 'csharp', 'java', 'go', 'ruby']
# TODO(jtattermusch): add empty_stream once PHP starts supporting it.
# TODO(jtattermusch): add timeout_on_sleeping_server once java starts supporting it.
@@ -260,6 +259,9 @@ _TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong',
'client_streaming', 'server_streaming',
'cancel_after_begin', 'cancel_after_first_response']
+_AUTH_TEST_CASES = ['compute_engine_creds', 'jwt_token_creds',
+ 'oauth2_auth_token', 'per_rpc_creds']
+
def docker_run_cmdline(cmdline, image, docker_args=[], cwd=None, environ=None):
"""Wraps given cmdline array to create 'docker run' cmdline from it."""
@@ -288,22 +290,54 @@ def bash_login_cmdline(cmdline):
return ['bash', '-l', '-c', ' '.join(cmdline)]
-def cloud_to_prod_jobspec(language, test_case, docker_image=None):
+def add_auth_options(language, test_case, cmdline, env):
+ """Returns (cmdline, env) tuple with cloud_to_prod_auth test options."""
+
+ language = str(language)
+ cmdline = list(cmdline)
+ env = env.copy()
+
+ # TODO(jtattermusch): this file path only works inside docker
+ key_filepath = '/root/service_account/stubbyCloudTestingTest-ee3fce360ac5.json'
+ oauth_scope_arg = '--oauth_scope=https://www.googleapis.com/auth/xapi.zoo'
+ key_file_arg = '--service_account_key_file=%s' % key_filepath
+ default_account_arg = '--default_service_account=830293263384-compute@developer.gserviceaccount.com'
+
+ if test_case in ['jwt_token_creds', 'per_rpc_creds', 'oauth2_auth_token']:
+ if language in ['csharp', 'node', 'php', 'ruby']:
+ env['GOOGLE_APPLICATION_CREDENTIALS'] = key_filepath
+ else:
+ cmdline += [key_file_arg]
+
+ if test_case in ['per_rpc_creds', 'oauth2_auth_token']:
+ cmdline += [oauth_scope_arg]
+
+ if test_case == 'compute_engine_creds':
+ cmdline += [oauth_scope_arg, default_account_arg]
+
+ return (cmdline, env)
+
+
+def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False):
"""Creates jobspec for cloud-to-prod interop test"""
- cmdline = bash_login_cmdline(language.cloud_to_prod_args() +
- ['--test_case=%s' % test_case])
+ cmdline = language.cloud_to_prod_args() + ['--test_case=%s' % test_case]
cwd = language.client_cwd
environ = language.cloud_to_prod_env()
+ if auth:
+ cmdline, environ = add_auth_options(language, test_case, cmdline, environ)
+ cmdline = bash_login_cmdline(cmdline)
+
if docker_image:
cmdline = docker_run_cmdline(cmdline, image=docker_image, cwd=cwd, environ=environ)
cwd = None
environ = None
+ suite_name='cloud_to_prod_auth' if auth else 'cloud_to_prod'
test_job = jobset.JobSpec(
cmdline=cmdline,
cwd=cwd,
environ=environ,
- shortname="cloud_to_prod:%s:%s" % (language, test_case),
+ shortname="%s:%s:%s" % (suite_name, language, test_case),
timeout_seconds=2*60,
flake_retries=5 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0)
@@ -382,6 +416,11 @@ argp.add_argument('--cloud_to_prod',
action='store_const',
const=True,
help='Run cloud_to_prod tests.')
+argp.add_argument('--cloud_to_prod_auth',
+ default=False,
+ action='store_const',
+ const=True,
+ help='Run cloud_to_prod_auth tests.')
argp.add_argument('-s', '--server',
choices=['all'] + sorted(_SERVERS),
action='append',
@@ -476,6 +515,14 @@ try:
docker_image=docker_images.get(str(language)))
jobs.append(test_job)
+ if args.cloud_to_prod_auth:
+ for language in languages:
+ for test_case in _AUTH_TEST_CASES:
+ test_job = cloud_to_prod_jobspec(language, test_case,
+ docker_image=docker_images.get(str(language)),
+ auth=True)
+ jobs.append(test_job)
+
for server in args.override_server:
server_name = server[0]
(server_host, server_port) = server[1].split(':')
diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh
index e322ab1995..780969089d 100755
--- a/tools/run_tests/run_node.sh
+++ b/tools/run_tests/run_node.sh
@@ -37,19 +37,15 @@ cd $(dirname $0)/../..
root=`pwd`
-cd $root/src/node
-
-export LD_LIBRARY_PATH=$root/libs/$CONFIG
-
if [ "$CONFIG" = "gcov" ]
then
- ./node_modules/.bin/istanbul cover --dir ../../reports/node_coverage \
- ./node_modules/.bin/_mocha -- --timeout 8000
+ ./node_modules/.bin/istanbul cover --dir reports/node_coverage \
+ ./node_modules/.bin/_mocha -- --timeout 8000 src/node/test
cd build
gcov Release/obj.target/grpc/ext/*.o
lcov --base-directory . --directory . -c -o coverage.info
- genhtml -o ../../../reports/node_ext_coverage --num-spaces 2 \
+ genhtml -o ../reports/node_ext_coverage --num-spaces 2 \
-t 'Node gRPC test coverage' coverage.info
else
- ./node_modules/mocha/bin/mocha --timeout 8000
+ ./node_modules/mocha/bin/mocha --timeout 8000 src/node/test
fi
diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh
index e2135be04c..848775e9b1 100755
--- a/tools/run_tests/run_python.sh
+++ b/tools/run_tests/run_python.sh
@@ -40,4 +40,4 @@ export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG
export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH
source "python"$PYVER"_virtual_environment"/bin/activate
-"python"$PYVER $GRPCIO_TEST/setup.py test -a "-n8 --cov=grpc --junitxml=./report.xml --timeout=300"
+"python"$PYVER $GRPCIO_TEST/setup.py test -a "-n8 --cov=grpc --junitxml=./report.xml --timeout=300 -v --boxed --timeout_method=thread"
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index e938520403..122102ea05 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -181,45 +181,6 @@ class CLanguage(object):
def __str__(self):
return self.make_target
-
-def gyp_test_paths(travis, config=None):
- binaries = get_c_tests(travis, 'c')
- out = []
- for target in binaries:
- if config is not None and config.build_config in target['exclude_configs']:
- continue
- binary = 'out/Debug/%s' % target['name']
- out.append(binary)
- return sorted(out)
-
-
-class GYPCLanguage(object):
-
- def test_specs(self, config, travis):
- return [config.job_spec([binary], [binary])
- for binary in gyp_test_paths(travis, config)]
-
- def pre_build_steps(self):
- return [['gyp', '--depth=.', '--suffix=-gyp', 'grpc.gyp']]
-
- def make_targets(self):
- # HACK(ctiller): force fling_client and fling_server to be built, as fling_test
- # needs these
- return gyp_test_paths(False) + ['fling_client', 'fling_server']
-
- def build_steps(self):
- return []
-
- def makefile_name(self):
- return 'Makefile-gyp'
-
- def supports_multi_config(self):
- return False
-
- def __str__(self):
- return 'gyp'
-
-
class NodeLanguage(object):
def test_specs(self, config, travis):
@@ -230,7 +191,7 @@ class NodeLanguage(object):
return []
def make_targets(self):
- return ['static_c', 'shared_c']
+ return []
def build_steps(self):
return [['tools/run_tests/build_node.sh']]
@@ -483,7 +444,6 @@ _DEFAULT = ['opt']
_LANGUAGES = {
'c++': CLanguage('cxx', 'c++'),
'c': CLanguage('c', 'c'),
- 'gyp': GYPCLanguage(),
'node': NodeLanguage(),
'php': PhpLanguage(),
'python': PythonLanguage(),
@@ -713,21 +673,24 @@ def _start_port_server(port_server_port):
# if not running ==> start a new one
# otherwise, leave it up
try:
- version = urllib2.urlopen('http://localhost:%d/version' % port_server_port,
- timeout=1).read()
- print 'detected port server running'
+ version = int(urllib2.urlopen(
+ 'http://localhost:%d/version_number' % port_server_port,
+ timeout=1).read())
+ print 'detected port server running version %d' % version
running = True
- except Exception:
+ except Exception as e:
print 'failed to detect port server: %s' % sys.exc_info()[0]
+ print e.strerror
running = False
if running:
- with open('tools/run_tests/port_server.py') as f:
- current_version = hashlib.sha1(f.read()).hexdigest()
- running = (version == current_version)
- if not running:
- print 'port_server version mismatch: killing the old one'
- urllib2.urlopen('http://localhost:%d/quit' % port_server_port).read()
- time.sleep(1)
+ current_version = int(subprocess.check_output(
+ [sys.executable, 'tools/run_tests/port_server.py', 'dump_version']))
+ print 'my port server is version %d' % current_version
+ running = (version >= current_version)
+ if not running:
+ print 'port_server version mismatch: killing the old one'
+ urllib2.urlopen('http://localhost:%d/quitquitquit' % port_server_port).read()
+ time.sleep(1)
if not running:
print 'starting port_server'
port_log = open('portlog.txt', 'w')
@@ -773,7 +736,7 @@ def _build_and_run(
# start antagonists
antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py'])
for _ in range(0, args.antagonists)]
- port_server_port = 9999
+ port_server_port = 32767
_start_port_server(port_server_port)
try:
infinite_runs = runs_per_test == 0