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
- Windows, test-wrapper: rename flag in Bazel Rename the "--windows_native_test_wrapper" flag to "--incompatible_windows_native_test_wrapper", in order to comply with the "Communicating Breaking Change... — committed to laszlocsomor/bazel by laszlocsomor 6 years ago
- Windows, test-wrapper: rename flag in Bazel Rename the "--windows_native_test_wrapper" flag to "--incompatible_windows_native_test_wrapper", in order to comply with the "Communicating Breaking Change... — committed to bazelbuild/bazel by laszlocsomor 6 years ago
- Windows, test-wrapper: write undeclared outputs mf In this commit: - implement logic to write the undeclared outputs manifest - add directories to the undeclared outputs zip, as Bazel does on L... — committed to laszlocsomor/bazel by laszlocsomor 6 years ago
- Windows, test-wrapper: write undeclared outputs mf In this commit: - implement logic to write the undeclared outputs manifest - add directories to the undeclared outputs zip, as Bazel does on L... — committed to laszlocsomor/bazel by laszlocsomor 6 years ago
- Windows: add --incompatible_windows_native_test_wrapper Add the --incompatible_windows_native_test_wrapper flag (default: false). This flag has no effect on platforms other than Windows. When using ... — committed to laszlocsomor/bazel by laszlocsomor 5 years ago
- Windows: add --incompatible_windows_native_test_wrapper Add the --incompatible_windows_native_test_wrapper flag (default: false). This flag has no effect on platforms other than Windows. When using ... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: add --incompatible_windows_native_test_wrapper Add the --incompatible_windows_native_test_wrapper flag (default: false). This flag has no effect on platforms other than Windows. When using ... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: fix tests for native test wrapper All tests work with `--incompatible_windows_native_test_wrapper` except for the ones already broken on Windows (//tests:analysis_test_e2e_test and //tests:u... — committed to laszlocsomor/bazel-skylib by laszlocsomor 5 years ago
- Windows: fix tests for native test wrapper (#129) All tests work with `--incompatible_windows_native_test_wrapper` except for the ones already broken on Windows (//tests:analysis_test_e2e_test and... — committed to bazelbuild/bazel-skylib by laszlocsomor 5 years ago
- Replace genrules with copy_file/write_file rules The new rules are in bazel_skylib 0.8.0. Their advantages over genrule are: - cleaner rule interface - no Bash required on Windows - compatible with ... — committed to laszlocsomor/rules_nodejs by laszlocsomor 5 years ago
- Replace genrules with copy_file/write_file rules The new rules are in bazel_skylib 0.8.0. Their advantages over genrule are: - cleaner rule interface - no Bash required on Windows - compatible with ... — committed to laszlocsomor/rules_nodejs by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Fi... — committed to laszlocsomor/bazel by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Replace genrules with copy_file/write_file rules The new rules are in bazel_skylib 0.8.0. Their advantages over genrule are: - cleaner rule interface - no Bash required on Windows - compatible with ... — committed to laszlocsomor/rules_nodejs by laszlocsomor 5 years ago
- Replace genrules with copy_file/write_file rules (#658) The new rules are in bazel_skylib 0.8.0. Their advantages over genrule are: - cleaner rule interface - no Bash required on Windows - comp... — committed to bazelbuild/rules_nodejs by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
- Windows: fix native test wrapper's arg. escaping The native test wrapper now correctly escapes the arguments for the subprocess, using bazel::launcher::WindowsEscapeArg2 from the native launcher. Th... — committed to bazelbuild/bazel by laszlocsomor 5 years ago
Thank you 😂