bazel: incompatible_windows_native_test_wrapper: enables Bash-less test execution on Windows

Description

The option --incompatible_windows_native_test_wrapper enables using the Bash-less test wrapper on Windows. This flag has NO effect on other platforms.

When using bazel test, Bazel does not execute tests directly. Instead Bazel runs a “test wrapper” as a subprocess, which sets up the environment for the test and runs the test.

By default, Bazel uses a Bash script (@bazel_tools//tools/test:test-setup.sh) as the test wrapper, on all platforms. The new flag allows using an alternative test wrapper written in C++ that does not depend on Bash.

When the flag is enabled, Bazel uses the C++ test wrapper from @bazel_tools//tools/test:tw. This test wrapper does not depend on Bash, but it’s new and has not yet been battle-tested.

When the flag is disabled, Bazel uses the Bash script test wrapper also used on every other platform, from @bazel_tools//tools/test:test-setup.sh. This script requires Bash. It has always been the way to run tests with Bazel, so it’s battle-tested.

Related bug: https://github.com/bazelbuild/bazel/issues/5508

Backwards-compatibility

The new test wrapper is designed to be backwards-compatible with the Bash-script based one. We do not expect any incompatibilities.

Migration recipe

None, as of 2019-03-06.

If you do find that this flag breaks your tests, please let us know so we can find a solution.

Rollout plan

Bazel 0.24.0 will not support this flag. Bazel 0.25.0 is expected to support this flag, with default value being false. Bazel 0.26.0 is expected to flip this flag to true. Bazel 0.27.0 is expected to remove this flag.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Thank you 😂