Fix Bazel 7 build (more) (#35392)

It turned out that the previous change missed two things which this PR
has

- Fix function `_dockerized_genrule` not to have `timeout` and `flaky`
which Bazel doesn't have. (Bazel 7 may either drop these arguments or
become more strict about passing unrecognized ones)
- Disabled python bazel distribution tests with Bazel 7. This needs to
be addressed by https://github.com/grpc/grpc/issues/35391.
pull/35311/head
Esun Kim 1 year ago committed by GitHub
parent 5d43fa00e4
commit 1e4fb21b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      tools/bazelify_tests/build_defs.bzl
  2. 3
      tools/bazelify_tests/test/bazel_distribtests.bzl

@ -63,7 +63,7 @@ def _dockerized_sh_test(name, srcs = [], args = [], data = [], size = "medium",
**test_args
)
def _dockerized_genrule(name, cmd, outs, srcs = [], timeout = None, tags = [], exec_compatible_with = [], flaky = None, docker_image_version = None, docker_run_as_root = False):
def _dockerized_genrule(name, cmd, outs, srcs = [], tags = [], exec_compatible_with = [], docker_image_version = None, docker_run_as_root = False):
"""Runs genrule under docker either via RBE or via docker sandbox."""
if docker_image_version:
image_spec = DOCKERIMAGE_CURRENT_VERSIONS.get(docker_image_version, None)
@ -94,8 +94,6 @@ def _dockerized_genrule(name, cmd, outs, srcs = [], timeout = None, tags = [], e
"cmd": cmd,
"srcs": srcs,
"tags": tags,
"flaky": flaky,
"timeout": timeout,
"exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
"outs": outs,
@ -292,7 +290,7 @@ def grpc_build_artifact_task(name, timeout = None, artifact_deps = [], tags = []
cmd = cmd + " $(location " + dep_archive_name + ")"
genrule_srcs.append(dep_archive_name)
_dockerized_genrule(name = name, cmd = cmd, outs = genrule_outs, srcs = genrule_srcs, timeout = timeout, tags = tags, exec_compatible_with = exec_compatible_with, flaky = flaky, docker_image_version = docker_image_version, docker_run_as_root = False)
_dockerized_genrule(name = name, cmd = cmd, outs = genrule_outs, srcs = genrule_srcs, tags = tags, exec_compatible_with = exec_compatible_with, docker_image_version = docker_image_version, docker_run_as_root = False)
# The genrule above always succeeds (even if the underlying build fails), so that we can create rules that depend
# on multiple artifact builds (of which some can fail). The actual build status (exitcode) and the log of the build

@ -35,6 +35,9 @@ def generate_bazel_distribtests(name):
for bazel_version in SUPPORTED_BAZEL_VERSIONS:
for shard_name in _TEST_SHARDS:
# TODO(https://github.com/grpc/grpc/issues/35391): Fix bazel 7 + distribtest_python test
if bazel_version.startswith("7") and shard_name == "distribtest_python":
continue
test_name = "bazel_distribtest_%s_%s" % (bazel_version, shard_name)
grpc_run_bazel_distribtest_test(
name = test_name,

Loading…
Cancel
Save