| 1 |
#!/bin/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 |
|
| 16 |
# Build portability tests with an updated submodule |
| 17 |
|
| 18 |
set -ex |
| 19 |
|
| 20 |
# change to grpc repo root |
| 21 |
cd $(dirname $0)/../../.. |
| 22 |
|
| 23 |
source tools/internal_ci/helper_scripts/prepare_build_linux_rc |
| 24 |
|
| 25 |
# Submodule name is passed as the RUN_TESTS_FLAGS variable |
| 26 |
SUBMODULE_NAME="${RUN_TESTS_FLAGS}" |
| 27 |
|
| 28 |
# Name of branch to checkout is passed as BAZEL_FLAGS variable |
| 29 |
# If unset, "master" is used by default. |
| 30 |
SUBMODULE_BRANCH_NAME="${BAZEL_FLAGS:-master}" |
| 31 |
|
| 32 |
# Update submodule to be tested at HEAD |
| 33 |
(cd "third_party/${SUBMODULE_NAME}" && git fetch origin && git checkout "origin/${SUBMODULE_BRANCH_NAME}") |
| 34 |
|
| 35 |
echo "This suite tests whether gRPC HEAD builds with HEAD of submodule '${SUBMODULE_NAME}'" |
| 36 |
echo "If a test breaks, either" |
| 37 |
echo "1) some change in the grpc repository has caused the failure" |
| 38 |
echo "2) some change that was just merged in the submodule head has caused the failure." |
| 39 |
|
| 40 |
echo "" |
| 41 |
echo "submodule '${SUBMODULE_NAME}' is at commit: $(cd third_party/${SUBMODULE_NAME}; git rev-parse --verify HEAD)" |
| 42 |
|
| 43 |
if [ "${SUBMODULE_NAME}" == "abseil-cpp" ] |
| 44 |
then |
| 45 |
src/abseil-cpp/preprocessed_builds.yaml.gen.py |
| 46 |
fi |
| 47 |
|
| 48 |
tools/buildgen/generate_projects.sh |
| 49 |
|
| 50 |
if [ "${SUBMODULE_NAME}" == "protobuf" ] |
| 51 |
then |
| 52 |
tools/distrib/python/make_grpcio_tools.py |
| 53 |
fi |
| 54 |
|
| 55 |
# commit so that changes are passed to Docker |
| 56 |
git -c user.name='foo' -c user.email='[email protected]' commit -a -m 'Update submodule' --allow-empty |
| 57 |
|
| 58 |
tools/run_tests/run_tests_matrix.py -f linux --exclude basictests_arm64 --inner_jobs 8 -j 4 --internal_ci --build_only |