diff options
author | murgatroid99 <mlumish@google.com> | 2016-01-13 11:42:18 -0800 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2016-01-13 11:42:18 -0800 |
commit | b70206fe52ee6509f3f965bf2a95b2cbd321088d (patch) | |
tree | fa59a43171854465c89af72734d45350070b7366 /tools/run_tests | |
parent | 295a7ce511f1a2145f70942f826d0e225c00ba62 (diff) | |
parent | 7149ca6bd0ce73a08fa512415d3f641a06a15a75 (diff) |
Merge branch 'master' into release-0_12_master_merge
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-x | tools/run_tests/build_python.sh | 8 | ||||
-rwxr-xr-x | tools/run_tests/jobset.py | 3 | ||||
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 14 | ||||
-rwxr-xr-x | tools/run_tests/run_python.sh | 6 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 55 | ||||
-rw-r--r-- | tools/run_tests/sources_and_headers.json | 123 |
6 files changed, 112 insertions, 97 deletions
diff --git a/tools/run_tests/build_python.sh b/tools/run_tests/build_python.sh index 57080ce934..e0fcbb602d 100755 --- a/tools/run_tests/build_python.sh +++ b/tools/run_tests/build_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,16 +34,14 @@ set -ex cd $(dirname $0)/../.. ROOT=`pwd` -GRPCIO=$ROOT/src/python/grpcio export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH -export CFLAGS="-I$ROOT/include -std=c89" +export CFLAGS="-I$ROOT/include -std=gnu99" export LDFLAGS="-L$ROOT/libs/$CONFIG" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1 -cd $GRPCIO tox --notest -$GRPCIO/.tox/py27/bin/python $GRPCIO/setup.py build +$ROOT/.tox/py27/bin/python $ROOT/setup.py build diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 0b01bc4bec..e33433daf2 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -450,4 +450,3 @@ def run(cmdlines, js.set_remaining(remaining) js.finish() return js.get_num_failures(), js.resultset - diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index f8798e1c4d..ce9aec437b 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -298,11 +298,8 @@ class PythonLanguage: def client_cmd(self, args): return [ - 'src/python/grpcio/.tox/py27/bin/python', - 'src/python/grpcio/setup.py', - 'run_interop', - '--client', - '--args=\'{}\''.format(' '.join(args)) + 'tox -einterop_client --', + ' '.join(args) ] def cloud_to_prod_env(self): @@ -310,11 +307,8 @@ class PythonLanguage: def server_cmd(self, args): return [ - 'src/python/grpcio/.tox/py27/bin/python', - 'src/python/grpcio/setup.py', - 'run_interop', - '--server', - '--args=\'{}\''.format(' '.join(args) + ' --use_tls=true') + 'tox -einterop_server --', + ' '.join(args) + ' --use_tls=true' ] def global_env(self): diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 042b40485d..ffe9c12af1 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -34,7 +34,6 @@ set -ex cd $(dirname $0)/../.. ROOT=`pwd` -GRPCIO=$ROOT/src/python/grpcio export LD_LIBRARY_PATH=$ROOT/libs/$CONFIG export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH @@ -43,9 +42,8 @@ export LDFLAGS="-L$ROOT/libs/$CONFIG" export GRPC_PYTHON_BUILD_WITH_CYTHON=1 export GRPC_PYTHON_ENABLE_CYTHON_TRACING=1 -cd $GRPCIO tox mkdir -p $ROOT/reports rm -rf $ROOT/reports/python-coverage -(mv -T $GRPCIO/htmlcov $ROOT/reports/python-coverage) || true +(mv -T $ROOT/htmlcov $ROOT/reports/python-coverage) || true diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 857e7b5f5d..0de20a634a 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -726,9 +726,11 @@ if 'all' in args.language: lang_list = _LANGUAGES.keys() else: lang_list = args.language -# We don't support code coverage on ObjC -if 'gcov' in args.config and 'objc' in lang_list: - lang_list.remove('objc') +# We don't support code coverage on some languages +if 'gcov' in args.config: + for bad in ['objc', 'sanity', 'build']: + if bad in lang_list: + lang_list.remove(bad) languages = set(_LANGUAGES[l] for l in lang_list) @@ -961,6 +963,15 @@ def _calculate_num_runs_failures(list_of_results): return num_runs, num_failures +# _build_and_run results +class BuildAndRunError(object): + + BUILD = object() + TEST = object() + POST_TEST = object() + + +# returns a list of things that failed (or an empty list on success) def _build_and_run( check_cancelled, newline_on_success, cache, xml_report=None, build_only=False): """Do one pass of building & running tests.""" @@ -969,10 +980,10 @@ def _build_and_run( build_steps, maxjobs=1, stop_on_failure=True, newline_on_success=newline_on_success, travis=args.travis) if num_failures: - return 1 + return [BuildAndRunError.BUILD] if build_only: - return 0 + return [] # start antagonists antagonists = [subprocess.Popen(['tools/run_tests/antagonist.py']) @@ -1030,12 +1041,16 @@ def _build_and_run( number_failures, _ = jobset.run( post_tests_steps, maxjobs=1, stop_on_failure=True, newline_on_success=newline_on_success, travis=args.travis) - if num_test_failures or number_failures: - return 2 + + out = [] + if number_failures: + out.append(BuildAndRunError.POST_TEST) + if num_test_failures: + out.append(BuildAndRunError.TEST) if cache: cache.save() - return 0 + return out test_cache = TestCache(runs_per_test == 1) @@ -1048,11 +1063,11 @@ if forever: initial_time = dw.most_recent_change() have_files_changed = lambda: dw.most_recent_change() != initial_time previous_success = success - success = _build_and_run(check_cancelled=have_files_changed, - newline_on_success=False, - cache=test_cache, - build_only=args.build_only) == 0 - if not previous_success and success: + errors = _build_and_run(check_cancelled=have_files_changed, + newline_on_success=False, + cache=test_cache, + build_only=args.build_only) == 0 + if not previous_success and not errors: jobset.message('SUCCESS', 'All tests are now passing properly', do_newline=True) @@ -1060,13 +1075,21 @@ if forever: while not have_files_changed(): time.sleep(1) else: - result = _build_and_run(check_cancelled=lambda: False, + errors = _build_and_run(check_cancelled=lambda: False, newline_on_success=args.newline_on_success, cache=test_cache, xml_report=args.xml_report, build_only=args.build_only) - if result == 0: + if not errors: jobset.message('SUCCESS', 'All tests passed', do_newline=True) else: jobset.message('FAILED', 'Some tests failed', do_newline=True) - sys.exit(result) + exit_code = 0 + if BuildAndRunError.BUILD in errors: + exit_code |= 1 + if BuildAndRunError.TEST in errors and not args.travis: + exit_code |= 2 + if BuildAndRunError.POST_TEST in errors: + exit_code |= 4 + sys.exit(exit_code) + diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index a17928cafd..2a13e350b3 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -1641,9 +1641,9 @@ "grpc++_test_config" ], "headers": [ - "test/cpp/util/metrics_server.h", - "test/proto/metrics.grpc.pb.h", - "test/proto/metrics.pb.h" + "src/proto/grpc/testing/metrics.grpc.pb.h", + "src/proto/grpc/testing/metrics.pb.h", + "test/cpp/util/metrics_server.h" ], "language": "c++", "name": "metrics_client", @@ -1773,12 +1773,12 @@ "grpc_test_util" ], "headers": [ - "test/proto/empty.grpc.pb.h", - "test/proto/empty.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h", - "test/proto/test.grpc.pb.h", - "test/proto/test.pb.h" + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h" ], "language": "c++", "name": "reconnect_interop_client", @@ -1799,12 +1799,12 @@ "test_tcp_server" ], "headers": [ - "test/proto/empty.grpc.pb.h", - "test/proto/empty.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h", - "test/proto/test.grpc.pb.h", - "test/proto/test.pb.h" + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h" ], "language": "c++", "name": "reconnect_interop_server", @@ -1935,18 +1935,18 @@ "grpc_test_util" ], "headers": [ + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/metrics.grpc.pb.h", + "src/proto/grpc/testing/metrics.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h", "test/cpp/interop/client_helper.h", "test/cpp/interop/interop_client.h", "test/cpp/interop/stress_interop_client.h", - "test/cpp/util/metrics_server.h", - "test/proto/empty.grpc.pb.h", - "test/proto/empty.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h", - "test/proto/metrics.grpc.pb.h", - "test/proto/metrics.pb.h", - "test/proto/test.grpc.pb.h", - "test/proto/test.pb.h" + "test/cpp/util/metrics_server.h" ], "language": "c++", "name": "stress_test", @@ -2021,7 +2021,10 @@ "grpc_test_util", "grpc_zookeeper" ], - "headers": [], + "headers": [ + "src/proto/grpc/testing/echo.grpc.pb.h", + "src/proto/grpc/testing/echo.pb.h" + ], "language": "c++", "name": "zookeeper_test", "src": [ @@ -3955,14 +3958,14 @@ "grpc_test_util" ], "headers": [ + "src/proto/grpc/testing/duplicate/echo_duplicate.grpc.pb.h", + "src/proto/grpc/testing/duplicate/echo_duplicate.pb.h", + "src/proto/grpc/testing/echo.grpc.pb.h", + "src/proto/grpc/testing/echo.pb.h", + "src/proto/grpc/testing/echo_messages.grpc.pb.h", + "src/proto/grpc/testing/echo_messages.pb.h", "test/cpp/util/cli_call.h", "test/cpp/util/create_test_channel.h", - "test/cpp/util/echo.grpc.pb.h", - "test/cpp/util/echo.pb.h", - "test/cpp/util/echo_duplicate.grpc.pb.h", - "test/cpp/util/echo_duplicate.pb.h", - "test/cpp/util/messages.grpc.pb.h", - "test/cpp/util/messages.pb.h", "test/cpp/util/string_ref_helper.h", "test/cpp/util/subprocess.h" ], @@ -4165,9 +4168,9 @@ "grpc_test_util" ], "headers": [ - "test/cpp/interop/client_helper.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h" + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "test/cpp/interop/client_helper.h" ], "language": "c++", "name": "interop_client_helper", @@ -4188,13 +4191,13 @@ "interop_client_helper" ], "headers": [ - "test/cpp/interop/interop_client.h", - "test/proto/empty.grpc.pb.h", - "test/proto/empty.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h", - "test/proto/test.grpc.pb.h", - "test/proto/test.pb.h" + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h", + "test/cpp/interop/interop_client.h" ], "language": "c++", "name": "interop_client_main", @@ -4233,12 +4236,12 @@ "interop_server_helper" ], "headers": [ - "test/proto/empty.grpc.pb.h", - "test/proto/empty.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h", - "test/proto/test.grpc.pb.h", - "test/proto/test.pb.h" + "src/proto/grpc/testing/empty.grpc.pb.h", + "src/proto/grpc/testing/empty.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/test.grpc.pb.h", + "src/proto/grpc/testing/test.pb.h" ], "language": "c++", "name": "interop_server_main", @@ -4253,29 +4256,29 @@ "grpc_test_util" ], "headers": [ + "src/proto/grpc/testing/control.grpc.pb.h", + "src/proto/grpc/testing/control.pb.h", + "src/proto/grpc/testing/messages.grpc.pb.h", + "src/proto/grpc/testing/messages.pb.h", + "src/proto/grpc/testing/payloads.grpc.pb.h", + "src/proto/grpc/testing/payloads.pb.h", + "src/proto/grpc/testing/perf_db.grpc.pb.h", + "src/proto/grpc/testing/perf_db.pb.h", + "src/proto/grpc/testing/services.grpc.pb.h", + "src/proto/grpc/testing/services.pb.h", + "src/proto/grpc/testing/stats.grpc.pb.h", + "src/proto/grpc/testing/stats.pb.h", "test/cpp/qps/client.h", "test/cpp/qps/driver.h", "test/cpp/qps/histogram.h", "test/cpp/qps/interarrival.h", - "test/cpp/qps/perf_db.grpc.pb.h", - "test/cpp/qps/perf_db.pb.h", "test/cpp/qps/perf_db_client.h", "test/cpp/qps/qps_worker.h", "test/cpp/qps/report.h", "test/cpp/qps/server.h", "test/cpp/qps/stats.h", "test/cpp/qps/timer.h", - "test/cpp/util/benchmark_config.h", - "test/proto/benchmarks/control.grpc.pb.h", - "test/proto/benchmarks/control.pb.h", - "test/proto/benchmarks/payloads.grpc.pb.h", - "test/proto/benchmarks/payloads.pb.h", - "test/proto/benchmarks/services.grpc.pb.h", - "test/proto/benchmarks/services.pb.h", - "test/proto/benchmarks/stats.grpc.pb.h", - "test/proto/benchmarks/stats.pb.h", - "test/proto/messages.grpc.pb.h", - "test/proto/messages.pb.h" + "test/cpp/util/benchmark_config.h" ], "language": "c++", "name": "qps", |