diff options
author | murgatroid99 <mlumish@google.com> | 2015-09-22 14:13:44 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2015-09-22 14:13:44 -0700 |
commit | 521300e6e882529c08362321afb9821a2912e265 (patch) | |
tree | fd22df2fa1b1aebc5ebac62181e9a4d2b482202b /tools/run_tests | |
parent | 08fac99e73d815c7f3527c84a84dce315816e13c (diff) | |
parent | e456f77644e5ef5b60c7332136047ab3f5d4454e (diff) |
Merge branch 'master' into core_gyp
Diffstat (limited to 'tools/run_tests')
-rwxr-xr-x | tools/run_tests/port_server.py | 4 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 50 | ||||
-rw-r--r-- | tools/run_tests/sources_and_headers.json | 6 |
3 files changed, 50 insertions, 10 deletions
diff --git a/tools/run_tests/port_server.py b/tools/run_tests/port_server.py index d14c829fe0..acb6deaae6 100755 --- a/tools/run_tests/port_server.py +++ b/tools/run_tests/port_server.py @@ -37,7 +37,6 @@ import os import socket import sys import time -import yaml argp = argparse.ArgumentParser(description='Server for httpcli_test') argp.add_argument('-p', '--port', default=12345, type=int) @@ -118,6 +117,9 @@ class Handler(BaseHTTPServer.BaseHTTPRequestHandler): self.end_headers() self.wfile.write(_MY_VERSION) elif self.path == '/dump': + # yaml module is not installed on Macs and Windows machines by default + # so we import it lazily (/dump action is only used for debugging) + import yaml self.send_response(200) self.send_header('Content-Type', 'text/plain') self.end_headers() diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index c57fad9d0f..13d60e6f7b 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -493,12 +493,6 @@ _WINDOWS_CONFIG = { 'opt': 'Release', } -# parse command line -argp = argparse.ArgumentParser(description='Run grpc tests.') -argp.add_argument('-c', '--config', - choices=['all'] + sorted(_CONFIGS.keys()), - nargs='+', - default=_DEFAULT) def runs_per_test_type(arg_str): """Auxilary function to parse the "runs_per_test" flag. @@ -519,6 +513,13 @@ def runs_per_test_type(arg_str): except: msg = "'{}' isn't a positive integer or 'inf'".format(arg_str) raise argparse.ArgumentTypeError(msg) + +# parse command line +argp = argparse.ArgumentParser(description='Run grpc tests.') +argp.add_argument('-c', '--config', + choices=['all'] + sorted(_CONFIGS.keys()), + nargs='+', + default=_DEFAULT) argp.add_argument('-n', '--runs_per_test', default=1, type=runs_per_test_type, help='A positive integer or "inf". If "inf", all tests will run in an ' 'infinite loop. Especially useful in combination with "-f"') @@ -545,11 +546,48 @@ argp.add_argument('-S', '--stop_on_failure', default=False, action='store_const', const=True) +argp.add_argument('--use_docker', + default=False, + action='store_const', + const=True, + help="Run all the tests under docker. That provides " + + "additional isolation and prevents the need to installs " + + "language specific prerequisites. Only available on Linux.") argp.add_argument('-a', '--antagonists', default=0, type=int) argp.add_argument('-x', '--xml_report', default=None, type=str, help='Generates a JUnit-compatible XML report') args = argp.parse_args() +if args.use_docker: + if not args.travis: + print 'Seen --use_docker flag, will run tests under docker.' + print + print 'IMPORTANT: The changes you are testing need to be locally committed' + print 'because only the committed changes in the current branch will be' + print 'copied to the docker environment.' + time.sleep(5) + + child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ] + run_tests_cmd = 'tools/run_tests/run_tests.py %s' % " ".join(child_argv[1:]) + + # TODO(jtattermusch): revisit if we need special handling for arch here + # set arch command prefix in case we are working with different arch. + arch_env = os.getenv('arch') + if arch_env: + run_test_cmd = 'arch %s %s' % (arch_env, run_test_cmd) + + env = os.environ.copy() + env['RUN_TESTS_COMMAND'] = run_tests_cmd + if args.xml_report: + env['XML_REPORT'] = args.xml_report + if not args.travis: + env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins. + + subprocess.check_call(['tools/jenkins/build_docker_and_run_tests.sh'], + shell=True, + env=env) + sys.exit(0) + # grab config run_configs = set(_CONFIGS[cfg] for cfg in itertools.chain.from_iterable( diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 7acf0ff095..3696e2d1d8 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12347,10 +12347,10 @@ "src/core/security/auth_filters.h", "src/core/security/base64.h", "src/core/security/credentials.h", + "src/core/security/handshake.h", "src/core/security/json_token.h", "src/core/security/jwt_verifier.h", "src/core/security/secure_endpoint.h", - "src/core/security/secure_transport_setup.h", "src/core/security/security_connector.h", "src/core/security/security_context.h", "src/core/statistics/census_interface.h", @@ -12564,14 +12564,14 @@ "src/core/security/credentials_posix.c", "src/core/security/credentials_win32.c", "src/core/security/google_default_credentials.c", + "src/core/security/handshake.c", + "src/core/security/handshake.h", "src/core/security/json_token.c", "src/core/security/json_token.h", "src/core/security/jwt_verifier.c", "src/core/security/jwt_verifier.h", "src/core/security/secure_endpoint.c", "src/core/security/secure_endpoint.h", - "src/core/security/secure_transport_setup.c", - "src/core/security/secure_transport_setup.h", "src/core/security/security_connector.c", "src/core/security/security_connector.h", "src/core/security/security_context.c", |