add google default creds go tests

cloud_to_prod_auth google_default_creds tests are for c++
pull/16702/head
Menghan Li 6 years ago
parent e5fb49bc66
commit c74e7fc668
  1. 28
      tools/run_tests/run_interop_tests.py

@ -777,12 +777,14 @@ def cloud_to_prod_jobspec(language,
] ]
if transport_security == 'tls': if transport_security == 'tls':
transport_security_options = ['--use_tls=true'] transport_security_options = ['--use_tls=true']
elif transport_security == 'google_default_credentials' and language == 'c++': elif transport_security == 'google_default_credentials' and str(
language) in ['c++', 'go']:
transport_security_options = [ transport_security_options = [
'--custom_credentials_type=google_default_credentials' '--custom_credentials_type=google_default_credentials'
] ]
else: else:
print('Invalid transport security option.') print('Invalid transport security option %s in cloud_to_prod_jobspec.' %
transport_security)
sys.exit(1) sys.exit(1)
cmdargs = cmdargs + transport_security_options cmdargs = cmdargs + transport_security_options
environ = dict(language.cloud_to_prod_env(), **language.global_env()) environ = dict(language.cloud_to_prod_env(), **language.global_env())
@ -817,8 +819,9 @@ def cloud_to_prod_jobspec(language,
cmdline=cmdline, cmdline=cmdline,
cwd=cwd, cwd=cwd,
environ=environ, environ=environ,
shortname='%s:%s:%s:%s' % (suite_name, language, server_host_nickname, shortname='%s:%s:%s:%s:%s' %
test_case), (suite_name, language, server_host_nickname, test_case,
transport_security),
timeout_seconds=_TEST_TIMEOUT, timeout_seconds=_TEST_TIMEOUT,
flake_retries=4 if args.allow_flakes else 0, flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0,
@ -848,7 +851,8 @@ def cloud_to_cloud_jobspec(language,
elif transport_security == 'insecure': elif transport_security == 'insecure':
interop_only_options += ['--use_tls=false'] interop_only_options += ['--use_tls=false']
else: else:
print('Invalid transport security option.') print('Invalid transport security option %s in cloud_to_cloud_jobspec.'
% transport_security)
sys.exit(1) sys.exit(1)
client_test_case = test_case client_test_case = test_case
@ -903,8 +907,8 @@ def cloud_to_cloud_jobspec(language,
cmdline=cmdline, cmdline=cmdline,
cwd=cwd, cwd=cwd,
environ=environ, environ=environ,
shortname='cloud_to_cloud:%s:%s_server:%s' % (language, server_name, shortname='cloud_to_cloud:%s:%s_server:%s:%s' %
test_case), (language, server_name, test_case, transport_security),
timeout_seconds=_TEST_TIMEOUT, timeout_seconds=_TEST_TIMEOUT,
flake_retries=4 if args.allow_flakes else 0, flake_retries=4 if args.allow_flakes else 0,
timeout_retries=2 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0,
@ -929,7 +933,8 @@ def server_jobspec(language,
elif transport_security == 'insecure': elif transport_security == 'insecure':
server_cmd += ['--use_tls=false'] server_cmd += ['--use_tls=false']
else: else:
print('Invalid transport security option.') print('Invalid transport security option %s in server_jobspec.' %
transport_security)
sys.exit(1) sys.exit(1)
cmdline = bash_cmdline(language.server_cmd(server_cmd)) cmdline = bash_cmdline(language.server_cmd(server_cmd))
environ = language.global_env() environ = language.global_env()
@ -1318,7 +1323,7 @@ try:
service_account_key_file, service_account_key_file,
transport_security='tls') transport_security='tls')
jobs.append(tls_test_job) jobs.append(tls_test_job)
if language == 'c++': if str(language) in ['c++', 'go']:
google_default_creds_test_job = cloud_to_prod_jobspec( google_default_creds_test_job = cloud_to_prod_jobspec(
language, language,
test_case, test_case,
@ -1370,7 +1375,9 @@ try:
service_account_key_file, service_account_key_file,
transport_security='tls') transport_security='tls')
jobs.append(tls_test_job) jobs.append(tls_test_job)
if language == 'c++': if str(language) in [
'go'
]: # Add more languages to the list to turn on tests.
google_default_creds_test_job = cloud_to_prod_jobspec( google_default_creds_test_job = cloud_to_prod_jobspec(
language, language,
test_case, test_case,
@ -1378,6 +1385,7 @@ try:
prod_servers[server_host_nickname], prod_servers[server_host_nickname],
docker_image=docker_images.get( docker_image=docker_images.get(
str(language)), str(language)),
auth=True,
manual_cmd_log=client_manual_cmd_log, manual_cmd_log=client_manual_cmd_log,
service_account_key_file=args. service_account_key_file=args.
service_account_key_file, service_account_key_file,

Loading…
Cancel
Save