This directory contains logic that wraps builds and tests from the non-bazel realm to make them runnable under bazel.
Examples: cmake builds, run_tests.py tests, artifacts, distribtests etc.
NOTE: all tests and their setup under this directory are currently EXPERIMENTAL.
The //tools/bazelify_tests:repo_archive
target produces an archive that contains grpc at the current head with all its submodules. The rule uses a few tricks to achieve this:
After grpc source code is archived, the “bazelified” tests basically depend on the archive and they run a script under a docker container. The script unpacks the archived grpc code and creates a temporary workspace (under bazel's target execroot) and then performs the actions that are needed (e.g. run the run_tests.py test harness, run cmake build etc).
There are two ways the test targets can run under a docker container:
In both cases, the docker image which is used for any given action is determined by the action‘s exec_properties
and can be specified as a default (e.g. by RBE toolchain or by setting --experimental_docker_image
flag) or explicitly for each action. For most tests in this directory, the test rules actually configure the exec_properties
for you, based on selecting one of the gRPC’s testing docker images.
# "--genrule_strategy=remote,local" allows fallback to local execution if action doesn't support running remotely # (required to be able to run the //tools/bazelify_tests:repo_archive target). tools/bazel --bazelrc=tools/remote_build/linux.bazelrc test --genrule_strategy=remote,local --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh //tools/bazelify_tests/test:basic_tests_linux
tools/bazel --bazelrc=tools/remote_build/linux_docker_sandbox.bazelrc test --workspace_status_command=tools/bazelify_tests/workspace_status_cmd.sh //tools/bazelify_tests/test:basic_tests_linux