Merge pull request #19274 from jtattermusch/fix_macos_interop_toprod

Fix macos interop toprod tests
reviewable/pr19288/r1
Jan Tattermusch 6 years ago committed by GitHub
commit 6f186fa8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      tools/internal_ci/macos/grpc_interop.cfg
  2. 31
      tools/internal_ci/macos/grpc_interop.sh
  3. 1
      tools/internal_ci/macos/grpc_interop_toprod.sh
  4. 35
      tools/run_tests/run_interop_tests.py

@ -1,26 +0,0 @@
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Config file for the internal CI (in protobuf text format)
# Location of the continuous shell script in repository.
build_file: "grpc/tools/internal_ci/macos/grpc_interop.sh"
gfile_resources: "/bigstore/grpc-testing-secrets/gcp_credentials/GrpcTesting-d0eeee2db331.json"
timeout_mins: 240
action {
define_artifacts {
regex: "**/*sponge_log.*"
regex: "github/grpc/reports/**"
}
}

@ -1,31 +0,0 @@
#!/bin/bash
# Copyright 2017 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
# change to grpc repo root
cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
source tools/internal_ci/helper_scripts/prepare_build_macos_rc
tools/run_tests/run_interop_tests.py -l objc -s all --use_docker -t -j 1 || FAILED="true"
tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true
if [ "$FAILED" != "" ]
then
exit 1
fi

@ -34,6 +34,7 @@ tools/run_tests/run_interop_tests.py -l c++ \
--google_default_creds_use_key_file \
--prod_servers default gateway_v4 \
--service_account_key_file="${KOKORO_KEYSTORE_DIR}/73836_interop_to_prod_tests_service_account_key" \
--default_service_account="interop-to-prod-tests@grpc-testing.iam.gserviceaccount.com" \
--skip_compute_engine_creds --internal_ci -t -j 4 || FAILED="true"
tools/internal_ci/helper_scripts/delete_nonartifacts.sh || true

@ -807,23 +807,17 @@ def compute_engine_creds_required(language, test_case):
return False
def auth_options(language,
test_case,
google_default_creds_use_key_file,
service_account_key_file=None):
def auth_options(language, test_case, google_default_creds_use_key_file,
service_account_key_file, default_service_account):
"""Returns (cmdline, env) tuple with cloud_to_prod_auth test options."""
language = str(language)
cmdargs = []
env = {}
if not service_account_key_file:
# this file path only works inside docker
service_account_key_file = '/root/service_account/grpc-testing-ebe7c1ac7381.json'
oauth_scope_arg = '--oauth_scope=https://www.googleapis.com/auth/xapi.zoo'
key_file_arg = '--service_account_key_file=%s' % service_account_key_file
# default compute engine credentials associated with the testing VMs in "grpc-testing" cloud project
default_account_arg = '--default_service_account=830293263384-compute@developer.gserviceaccount.com'
default_account_arg = '--default_service_account=%s' % default_service_account
if test_case in ['jwt_token_creds', 'per_rpc_creds', 'oauth2_auth_token']:
if language in [
@ -874,6 +868,7 @@ def cloud_to_prod_jobspec(language,
auth=False,
manual_cmd_log=None,
service_account_key_file=None,
default_service_account=None,
transport_security='tls'):
"""Creates jobspec for cloud-to-prod interop test"""
container_name = None
@ -901,9 +896,9 @@ def cloud_to_prod_jobspec(language,
cmdargs = cmdargs + transport_security_options
environ = dict(language.cloud_to_prod_env(), **language.global_env())
if auth:
auth_cmdargs, auth_env = auth_options(language, test_case,
google_default_creds_use_key_file,
service_account_key_file)
auth_cmdargs, auth_env = auth_options(
language, test_case, google_default_creds_use_key_file,
service_account_key_file, default_service_account)
cmdargs += auth_cmdargs
environ.update(auth_env)
cmdline = bash_cmdline(language.client_cmd(cmdargs))
@ -1212,12 +1207,17 @@ argp.add_argument(
help=
'Use servername=HOST:PORT to explicitly specify a server. E.g. csharp=localhost:50000',
default=[])
# TODO(jtattermusch): the default service_account_key_file only works when --use_docker is used.
argp.add_argument(
'--service_account_key_file',
type=str,
help=
'Override the default service account key file to use for auth interop tests.',
default=None)
help='The service account key file to use for some auth interop tests.',
default='/root/service_account/grpc-testing-ebe7c1ac7381.json')
argp.add_argument(
'--default_service_account',
type=str,
help='Default GCE service account email to use for some auth interop tests.',
default='830293263384-compute@developer.gserviceaccount.com')
argp.add_argument(
'-t', '--travis', default=False, action='store_const', const=True)
argp.add_argument(
@ -1470,6 +1470,8 @@ try:
manual_cmd_log=client_manual_cmd_log,
service_account_key_file=args.
service_account_key_file,
default_service_account=args.
default_service_account,
transport_security=transport_security)
jobs.append(test_job)
if args.http2_interop:
@ -1484,6 +1486,7 @@ try:
docker_image=docker_images.get(str(http2Interop)),
manual_cmd_log=client_manual_cmd_log,
service_account_key_file=args.service_account_key_file,
default_service_account=args.default_service_account,
transport_security=args.transport_security)
jobs.append(test_job)
@ -1517,6 +1520,8 @@ try:
manual_cmd_log=client_manual_cmd_log,
service_account_key_file=args.
service_account_key_file,
default_service_account=args.
default_service_account,
transport_security=transport_security)
jobs.append(test_job)
for server in args.override_server:

Loading…
Cancel
Save