1#!/usr/bin/env bash 2# Copyright 2017 gRPC authors. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16set -ex 17 18# A temporary solution to give Kokoro credentials. 19# The file name 4321_grpc-testing-service needs to match auth_credential in 20# the build config. 21# TODO: Use keystore. 22mkdir -p ${KOKORO_KEYSTORE_DIR} 23cp ${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json ${KOKORO_KEYSTORE_DIR}/4321_grpc-testing-service 24 25temp_dir=$(mktemp -d) 26ln -f "${KOKORO_GFILE_DIR}/bazel-latest-release" ${temp_dir}/bazel 27chmod 755 "${KOKORO_GFILE_DIR}/bazel-latest-release" 28export PATH="${temp_dir}:${PATH}" 29# This should show ${temp_dir}/bazel 30which bazel 31chmod +x "${KOKORO_GFILE_DIR}/bazel_wrapper.py" 32 33# change to grpc repo root 34cd $(dirname $0)/../../.. 35 36source tools/internal_ci/helper_scripts/prepare_build_linux_rc 37 38export KOKORO_FOUNDRY_PROJECT_ID="projects/grpc-testing/instances/default_instance" 39 40"${KOKORO_GFILE_DIR}/bazel_wrapper.py" \ 41 --host_jvm_args=-Dbazel.DigestFunction=SHA256 \ 42 test --jobs="200" \ 43 --test_timeout="3600,3600,3600,3600" \ 44 --test_output=errors \ 45 --verbose_failures=true \ 46 --keep_going \ 47 --remote_accept_cached=true \ 48 --spawn_strategy=remote \ 49 --remote_local_fallback=false \ 50 --remote_timeout=3600 \ 51 --strategy=Javac=remote \ 52 --strategy=Closure=remote \ 53 --genrule_strategy=remote \ 54 --experimental_strict_action_env=true \ 55 --define GRPC_PORT_ISOLATED_RUNTIME=1 \ 56 --copt=-gmlt \ 57 --strip=never \ 58 --copt=-fsanitize=undefined \ 59 --linkopt=-fsanitize=undefined \ 60 --crosstool_top=@com_github_bazelbuild_bazeltoolchains//configs/experimental/ubuntu16_04_clang/1.0/bazel_0.15.0/ubsan:toolchain \ 61 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ 62 --extra_toolchains=@com_github_bazelbuild_bazeltoolchains//configs/ubuntu16_04_clang/1.0/bazel_0.16.1/cpp:cc-toolchain-clang-x86_64-default \ 63 --extra_execution_platforms=//third_party/toolchains:rbe_ubuntu1604 \ 64 --host_platform=//third_party/toolchains:rbe_ubuntu1604 \ 65 --platforms=//third_party/toolchains:rbe_ubuntu1604 \ 66 --cache_test_results=no \ 67 --test_env=GRPC_VERBOSITY=debug \ 68 --remote_instance_name=projects/grpc-testing/instances/default_instance \ 69 -- //test/... || FAILED="true" 70 71# Sleep to let ResultStore finish writing results before querying 72sleep 60 73python ./tools/run_tests/python_utils/upload_rbe_results.py 74 75if [ "$FAILED" != "" ] 76then 77 exit 1 78fi 79