diff options
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-x | tools/run_tests/build_python.sh | 7 | ||||
-rwxr-xr-x | tools/run_tests/jobset.py | 6 | ||||
-rwxr-xr-x | tools/run_tests/run_interops.py | 21 | ||||
-rwxr-xr-x | tools/run_tests/run_interops_build.sh | 36 | ||||
-rwxr-xr-x | tools/run_tests/run_interops_test.sh | 11 | ||||
-rwxr-xr-x | tools/run_tests/run_python.sh | 1 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 3 | ||||
-rw-r--r-- | tools/run_tests/sources_and_headers.json | 73 | ||||
-rw-r--r-- | tools/run_tests/tests.json | 45 |
9 files changed, 150 insertions, 53 deletions
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 203c8b7720..2efc2c714d 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -34,8 +34,10 @@ set -ex cd $(dirname $0)/../.. ROOT=`pwd` +PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH GRPCIO=$ROOT/src/python/grpcio GRPCIO_TEST=$ROOT/src/python/grpcio_test +GRPCIO_HEALTH_CHECKING=$ROOT/src/python/grpcio_health_checking make_virtualenv() { virtualenv_name="python"$1"_virtual_environment" @@ -54,6 +56,9 @@ make_virtualenv() { cd $GRPCIO_TEST pip install -r requirements.txt pip install $GRPCIO_TEST + + # Install grpcio_health_checking + pip install $GRPCIO_HEALTH_CHECKING else source $virtualenv_name/bin/activate # Uninstall and re-install the packages we care about. Don't use @@ -62,12 +67,14 @@ make_virtualenv() { # 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) || ( # Fall back to rebuilding the entire environment rm -rf $virtualenv_name make_virtualenv $1 ) pip install $GRPCIO_TEST + pip install $GRPCIO_HEALTH_CHECKING fi } diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index b7e0089269..538deac0e3 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -131,7 +131,7 @@ class JobSpec(object): """Specifies what to run for a job.""" def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None, - cwd=None, shell=False, timeout_seconds=900): + cwd=None, shell=False, timeout_seconds=5*60): """ Arguments: cmdline: a list of arguments to pass as the command line @@ -194,6 +194,10 @@ class Job(object): self._tempfile.seek(0) stdout = self._tempfile.read() filtered_stdout = filter(lambda x: x in string.printable, stdout.decode(errors='ignore')) + # TODO: looks like jenkins master is slow because parsing the junit results XMLs is not + # implemented efficiently. This is an experiment to workaround the issue by making sure + # results.xml file is small enough. + filtered_stdout = filtered_stdout[-128:] if self._xml_test is not None: self._xml_test.set('time', str(elapsed)) ET.SubElement(self._xml_test, 'system-out').text = filtered_stdout diff --git a/tools/run_tests/run_interops.py b/tools/run_tests/run_interops.py index 1cf268526d..e1d40d32c1 100755 --- a/tools/run_tests/run_interops.py +++ b/tools/run_tests/run_interops.py @@ -4,24 +4,23 @@ import jobset argp = argparse.ArgumentParser(description='Run interop tests.') argp.add_argument('-l', '--language', - choices=['build_only', 'c++'], - nargs='+', - default=['build_only']) + default='c++') args = argp.parse_args() # build job -build_steps = 'tools/run_tests/run_interops_build.sh' -build_job = jobset.JobSpec(cmdline=build_steps, shortname='build') +build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%s' % args.language], shortname='build') -# test jobs +# test jobs, each test is a separate job to run in parallel _TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming'] jobs = [] jobNumber = 0 -for lang in args.language: - for test in _TESTS: - test_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_test.sh', '%s' % lang, '%s' % test], shortname=test) - jobs.append(test_job) - jobNumber+=1 +for test in _TESTS: + test_job = jobset.JobSpec( + cmdline=['tools/run_tests/run_interops_test.sh', '%s' % args.language, '%s' % test], + shortname=test, + timeout_seconds=15*60) + jobs.append(test_job) + jobNumber+=1 root = ET.Element('testsuites') testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') diff --git a/tools/run_tests/run_interops_build.sh b/tools/run_tests/run_interops_build.sh index 23441a5300..ff1a26cf89 100755 --- a/tools/run_tests/run_interops_build.sh +++ b/tools/run_tests/run_interops_build.sh @@ -29,6 +29,8 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +language=$1 + set -e #clean up any old docker files and start mirroring repository if not started already @@ -40,8 +42,34 @@ sudo docker run -d -e GCS_BUCKET=docker-interop-images -e STORAGE_PATH=/admin/d #prepare building by pulling down base images and necessary files sudo docker pull 0.0.0.0:5000/grpc/base sudo docker tag -f 0.0.0.0:5000/grpc/base grpc/base -gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx -gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx -#build docker file, add more languages later -sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx +if [ "$language" = "c++" ] +then + gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_cxx + gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_cxx + sudo docker build --no-cache -t grpc/cxx tools/dockerfile/grpc_cxx +elif [ "$language" = "node" ] +then + sudo docker pull 0.0.0.0:5000/grpc/node_base + sudo docker tag -f 0.0.0.0:5000/grpc/node_base grpc/node_base + gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_node + gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_node + sudo docker build --no-cache -t grpc/node tools/dockerfile/grpc_node +elif [ "$language" = "ruby" ] +then + sudo docker pull 0.0.0.0:5000/grpc/ruby_base + sudo docker tag -f 0.0.0.0:5000/grpc/ruby_base grpc/ruby_base + gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_ruby + gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_ruby + sudo docker build --no-cache -t grpc/ruby tools/dockerfile/grpc_ruby +elif [ "$language" = "php" ] +then + sudo docker pull 0.0.0.0:5000/grpc/php_base + sudo docker tag -f 0.0.0.0:5000/grpc/php_base grpc/php_base + gsutil cp -R gs://docker-interop-images/admin/service_account tools/dockerfile/grpc_php + gsutil cp -R gs://docker-interop-images/admin/cacerts tools/dockerfile/grpc_php + sudo docker build --no-cache -t grpc/php tools/dockerfile/grpc_php +else + echo "interop testss not added for $language" + exit 1 +fi diff --git a/tools/run_tests/run_interops_test.sh b/tools/run_tests/run_interops_test.sh index 1d0eedad85..9be253af46 100755 --- a/tools/run_tests/run_interops_test.sh +++ b/tools/run_tests/run_interops_test.sh @@ -36,6 +36,17 @@ set -e if [ "$language" = "c++" ] then sudo docker run grpc/cxx /var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots --server_host_override=grpc-test.sandbox.google.com --server_host=grpc-test.sandbox.google.com --server_port=443 --test_case=$test_case +elif [ "$language" = "node" ] +then + sudo docker run grpc/node /usr/bin/nodejs /var/local/git/grpc/src/node/interop/interop_client.js --use_tls=true --use_test_ca=true --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com --test_case=$test_case +elif [ "$language" = "ruby" ] +then + cmd_prefix="SSL_CERT_FILE=/cacerts/roots.pem ruby /var/local/git/grpc/src/ruby/bin/interop/interop_client.rb --use_tls --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com " + cmd="$cmd_prefix --test_case=$test_case" + sudo docker run grpc/ruby bin/bash -l -c '$cmd' +elif [ "$language" = "php" ] +then + sudo docker run -e SSL_CERT_FILE=/cacerts/roots.pem grpc/php /var/local/git/grpc/src/php/bin/interop_client.sh --server_port=443 --server_host=grpc-test.sandbox.google.com --server_host_override=grpc-test.sandbox.google.com --test_case=$test_case else echo "interop testss not added for $language" exit 1 diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 5ffd4460b9..6f80219b0e 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -37,5 +37,6 @@ ROOT=`pwd` GRPCIO_TEST=$ROOT/src/python/grpcio_test export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG 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" diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 47d2b6183e..1a6752c784 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -470,7 +470,8 @@ else: '-j', '%d' % (multiprocessing.cpu_count() + 1), 'EXTRA_DEFINES=GRPC_TEST_SLOWDOWN_MACHINE_FACTOR=%f' % args.slowdown, - 'CONFIG=%s' % cfg] + targets) + 'CONFIG=%s' % cfg] + targets, + timeout_seconds=30*60) build_steps = [make_jobspec(cfg, list(set(itertools.chain.from_iterable( diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index a855f310f7..72e6c41508 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -244,18 +244,6 @@ ], "headers": [], "language": "c", - "name": "gpr_cancellable_test", - "src": [ - "test/core/support/cancellable_test.c" - ] - }, - { - "deps": [ - "gpr", - "gpr_test_util" - ], - "headers": [], - "language": "c", "name": "gpr_cmdline_test", "src": [ "test/core/support/cmdline_test.c" @@ -994,6 +982,20 @@ ], "headers": [], "language": "c", + "name": "udp_server_test", + "src": [ + "test/core/iomgr/udp_server_test.c" + ] + }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", "name": "uri_parser_test", "src": [ "test/core/client_config/uri_parser_test.c" @@ -1685,6 +1687,23 @@ }, { "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc++", + "grpc++_test_util", + "grpc_test_util", + "grpc_zookeeper" + ], + "headers": [], + "language": "c++", + "name": "zookeeper_test", + "src": [ + "test/cpp/end2end/zookeeper_test.cc" + ] + }, + { + "deps": [ "end2end_certs", "end2end_fixture_chttp2_fake_security", "end2end_test_bad_hostname", @@ -12101,7 +12120,6 @@ "include/grpc/support/atm_gcc_atomic.h", "include/grpc/support/atm_gcc_sync.h", "include/grpc/support/atm_win32.h", - "include/grpc/support/cancellable_platform.h", "include/grpc/support/cmdline.h", "include/grpc/support/cpu.h", "include/grpc/support/histogram.h", @@ -12140,7 +12158,6 @@ "include/grpc/support/atm_gcc_atomic.h", "include/grpc/support/atm_gcc_sync.h", "include/grpc/support/atm_win32.h", - "include/grpc/support/cancellable_platform.h", "include/grpc/support/cmdline.h", "include/grpc/support/cpu.h", "include/grpc/support/histogram.h", @@ -12164,7 +12181,6 @@ "include/grpc/support/tls_pthread.h", "include/grpc/support/useful.h", "src/core/support/alloc.c", - "src/core/support/cancellable.c", "src/core/support/cmdline.c", "src/core/support/cpu_iphone.c", "src/core/support/cpu_linux.c", @@ -12295,6 +12311,7 @@ "src/core/iomgr/tcp_server.h", "src/core/iomgr/tcp_windows.h", "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/json/json.h", @@ -12483,6 +12500,8 @@ "src/core/iomgr/tcp_windows.h", "src/core/iomgr/time_averaged_stats.c", "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/udp_server.c", + "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -12766,6 +12785,7 @@ "src/core/iomgr/tcp_server.h", "src/core/iomgr/tcp_windows.h", "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_pipe.h", "src/core/iomgr/wakeup_fd_posix.h", "src/core/json/json.h", @@ -12939,6 +12959,8 @@ "src/core/iomgr/tcp_windows.h", "src/core/iomgr/time_averaged_stats.c", "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/udp_server.c", + "src/core/iomgr/udp_server.h", "src/core/iomgr/wakeup_fd_eventfd.c", "src/core/iomgr/wakeup_fd_nospecial.c", "src/core/iomgr/wakeup_fd_pipe.c", @@ -13042,6 +13064,23 @@ { "deps": [ "gpr", + "grpc" + ], + "headers": [ + "include/grpc/grpc_zookeeper.h", + "src/core/client_config/resolvers/zookeeper_resolver.h" + ], + "language": "c", + "name": "grpc_zookeeper", + "src": [ + "include/grpc/grpc_zookeeper.h", + "src/core/client_config/resolvers/zookeeper_resolver.c", + "src/core/client_config/resolvers/zookeeper_resolver.h" + ] + }, + { + "deps": [ + "gpr", "gpr_test_util", "grpc", "grpc_test_util" @@ -13065,7 +13104,6 @@ "include/grpc++/async_generic_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/auth_context.h", - "include/grpc++/auth_property_iterator.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", "include/grpc++/channel_interface.h", @@ -13116,7 +13154,6 @@ "include/grpc++/async_generic_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/auth_context.h", - "include/grpc++/auth_property_iterator.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", "include/grpc++/channel_interface.h", @@ -13241,7 +13278,6 @@ "include/grpc++/async_generic_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/auth_context.h", - "include/grpc++/auth_property_iterator.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", "include/grpc++/channel_interface.h", @@ -13289,7 +13325,6 @@ "include/grpc++/async_generic_service.h", "include/grpc++/async_unary_call.h", "include/grpc++/auth_context.h", - "include/grpc++/auth_property_iterator.h", "include/grpc++/byte_buffer.h", "include/grpc++/channel_arguments.h", "include/grpc++/channel_interface.h", diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 79dcb31dd6..c25c0f3d7d 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -238,23 +238,6 @@ ], "flaky": false, "language": "c", - "name": "gpr_cancellable_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, - { - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "flaky": false, - "language": "c", "name": "gpr_cmdline_test", "platforms": [ "linux", @@ -1073,6 +1056,17 @@ }, { "ci_platforms": [ + "posix" + ], + "flaky": false, + "language": "c", + "name": "udp_server_test", + "platforms": [ + "posix" + ] + }, + { + "ci_platforms": [ "linux", "mac", "posix", @@ -1498,6 +1492,23 @@ { "ci_platforms": [ "linux", + "mac", + "posix", + "windows" + ], + "flaky": false, + "language": "c++", + "name": "zookeeper_test", + "platforms": [ + "linux", + "mac", + "posix", + "windows" + ] + }, + { + "ci_platforms": [ + "linux", "posix", "windows" ], |