• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
18set -ex
19
20# change to grpc repo root
21cd $(dirname $0)/../../..
22
23source tools/internal_ci/helper_scripts/prepare_build_linux_rc
24
25# Submodule name is passed as the RUN_TESTS_FLAGS variable
26SUBMODULE_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.
30SUBMODULE_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
35echo "This suite tests whether gRPC HEAD builds with HEAD of submodule '${SUBMODULE_NAME}'"
36echo "If a test breaks, either"
37echo "1) some change in the grpc repository has caused the failure"
38echo "2) some change that was just merged in the submodule head has caused the failure."
39
40echo ""
41echo "submodule '${SUBMODULE_NAME}' is at commit: $(cd third_party/${SUBMODULE_NAME}; git rev-parse --verify HEAD)"
42
43if [ "${SUBMODULE_NAME}" == "abseil-cpp" ]
44then
45  src/abseil-cpp/preprocessed_builds.yaml.gen.py
46fi
47
48tools/buildgen/generate_projects.sh
49
50if [ "${SUBMODULE_NAME}" == "protobuf" ]
51then
52  tools/distrib/python/make_grpcio_tools.py
53fi
54
55# commit so that changes are passed to Docker
56git -c user.name='foo' -c user.email='foo@google.com' commit -a -m 'Update submodule' --allow-empty
57
58tools/run_tests/run_tests_matrix.py -f linux --inner_jobs 4 -j 4 --internal_ci --build_only
59