mirror of https://github.com/grpc/grpc.git
Add bazel distribtests (minimalist version that only tests with bazel 3.x and 4.x) (#27486)
* Make repo globally buildable * Add initial distrib test script * Add test script * Support multiple versions * Split out a separate latest version test * Integrate with kokoro * make tools/bazel version overridable * added simplified test_single_bazel_version.sh * cleanup .bazelignore * only test 3.x and 4.x * always test all the bazel versions * revert unnecessary changes * revert unnecessary changes * fix shellcheck error Co-authored-by: Richard Belleville <rbellevi@google.com>pull/27500/head
parent
044253e5bd
commit
fa8a122862
9 changed files with 221 additions and 1 deletions
@ -0,0 +1,36 @@ |
||||
#!/usr/bin/env bash |
||||
# Copyright 2021 The 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 |
||||
|
||||
cd "$(dirname "$0")" |
||||
|
||||
# TODO(jtattermusch): make build work with bazel 2.2.0 and bazel 1.2.1 if that's reasonably simple. |
||||
SUPPORTED_VERSIONS=( |
||||
"3.7.2" |
||||
"4.0.0" |
||||
) |
||||
|
||||
FAILED_VERSIONS="" |
||||
for VERSION in "${SUPPORTED_VERSIONS[@]}"; do |
||||
echo "Running bazel distribtest with bazel version ${VERSION}" |
||||
./test_single_bazel_version.sh "${VERSION}" || FAILED_VERSIONS="${FAILED_VERSIONS}${VERSION} " |
||||
done |
||||
|
||||
if [ "$FAILED_VERSIONS" != "" ] |
||||
then |
||||
echo "Bazel distribtest failed: Failed to build with bazel versions ${FAILED_VERSIONS}" |
||||
exit 1 |
||||
fi |
@ -0,0 +1,27 @@ |
||||
#!/usr/bin/env bash |
||||
# Copyright 2021 The 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 |
||||
|
||||
cd "$(dirname "$0")" |
||||
|
||||
GITHUB_URL="https://github.com" |
||||
REPO="bazelbuild/bazel" |
||||
|
||||
VERSION=$(curl -Ls "${GITHUB_URL}/${REPO}/releases/latest" | \ |
||||
grep "href=.*\.tar.gz" | \ |
||||
grep -o "[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*") |
||||
|
||||
./test_single_bazel_version.sh "$VERSION" |
@ -0,0 +1,45 @@ |
||||
#!/usr/bin/env bash |
||||
# Copyright 2021 The 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 |
||||
|
||||
if [ "$#" != "1" ] ; then |
||||
echo "Must supply bazel version to be tested." >/dev/stderr |
||||
exit 1 |
||||
fi |
||||
|
||||
VERSION="$1" |
||||
|
||||
cd "$(dirname "$0")"/../../.. |
||||
|
||||
EXCLUDED_TARGETS=( |
||||
# iOS platform fails the analysis phase since there is no toolchain available |
||||
# for it. |
||||
"-//src/objective-c/..." |
||||
"-//third_party/objective_c/..." |
||||
|
||||
# This could be a legitmate failure due to bitrot. |
||||
"-//src/proto/grpc/testing:test_gen_proto" |
||||
|
||||
# This appears to be a legitimately broken BUILD file. There's a reference to |
||||
# a non-existent "link_dynamic_library.sh". |
||||
"-//third_party/toolchains/bazel_0.26.0_rbe_windows:all" |
||||
|
||||
# TODO(jtattermusch): add back once fixed |
||||
"-//examples/android/binder/..." |
||||
) |
||||
|
||||
export OVERRIDE_BAZEL_VERSION="$VERSION" |
||||
bazel build -- //... "${EXCLUDED_TARGETS[@]}" |
@ -0,0 +1,26 @@ |
||||
# 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/linux/grpc_bazel_distribtest.sh" |
||||
timeout_mins: 120 |
||||
action { |
||||
define_artifacts { |
||||
regex: "**/*sponge_log.*" |
||||
regex: "github/grpc/reports/**" |
||||
regex: "github/grpc/artifacts/**" |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
#!/bin/bash |
||||
# Copyright 2021 The 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. |
||||
|
||||
# Build portability tests with an updated submodule |
||||
|
||||
set -ex |
||||
|
||||
# change to grpc repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
source tools/internal_ci/helper_scripts/prepare_build_linux_rc |
||||
|
||||
./test/distrib/bazel/run_bazel_distrib_test.sh |
@ -0,0 +1,26 @@ |
||||
# Copyright 2021 The 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: "tools/internal_ci/linux/grpc_bazel_distribtest_latest.sh" |
||||
timeout_mins: 120 |
||||
action { |
||||
define_artifacts { |
||||
regex: "**/*sponge_log.*" |
||||
regex: "github/grpc/reports/**" |
||||
regex: "github/grpc/artifacts/**" |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
#!/bin/bash |
||||
# Copyright 2021 The 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. |
||||
|
||||
# Build portability tests with an updated submodule |
||||
|
||||
set -ex |
||||
|
||||
# change to grpc repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
source tools/internal_ci/helper_scripts/prepare_build_linux_rc |
||||
|
||||
./test/distrib/bazel/test_latest_bazel_version.sh |
Loading…
Reference in new issue