Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

files_equal_test: rewrite as genrule + sh_test #2035

Merged
merged 2 commits into from
Apr 19, 2019

Conversation

laszlocsomor
Copy link
Contributor

Rewrite the files_equal_test() rules as a macro.
The macro creates:

  • a sh_test, the actual test rule
  • a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
and --incompatible_windows_native_test_wrapper

Fixes #2034

Rewrite the files_equal_test() rules as a macro.
The macro creates:
- a sh_test, the actual test rule
- a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
    and --incompatible_windows_native_test_wrapper
Copy link
Contributor

@jayconrod jayconrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@jayconrod jayconrod merged commit 52836fb into bazel-contrib:master Apr 19, 2019
@laszlocsomor laszlocsomor deleted the files_equal_test branch April 23, 2019 07:00
jayconrod pushed a commit that referenced this pull request May 8, 2019
Rewrite the files_equal_test() rules as a macro.
The macro creates:
- a sh_test, the actual test rule
- a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
    and --incompatible_windows_native_test_wrapper

Fixes #2034
jayconrod pushed a commit that referenced this pull request May 8, 2019
Rewrite the files_equal_test() rules as a macro.
The macro creates:
- a sh_test, the actual test rule
- a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
    and --incompatible_windows_native_test_wrapper

Fixes #2034
jayconrod pushed a commit that referenced this pull request May 8, 2019
Rewrite the files_equal_test() rules as a macro.
The macro creates:
- a sh_test, the actual test rule
- a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
    and --incompatible_windows_native_test_wrapper

Fixes #2034
blico pushed a commit to blico/rules_go that referenced this pull request May 10, 2019
Rewrite the files_equal_test() rules as a macro.
The macro creates:
- a sh_test, the actual test rule
- a genrule that writes the source for the sh_test

The old implementation was a Starlark test rule
with a Bash script executable. Such a test cannot
run on Windows with Bazel's Windows-native test
wrapper, because the test wrapper cannot create a
subprocess for .sh file, only for native binaries
like an .exe file.

The new implementation wraps the .sh file in a
sh_test, which builds an .exe file on Windows.
Bazel and the new native test wrapper can now run
files_equal_test.

[1] see bazelbuild/bazel#5508
    and --incompatible_windows_native_test_wrapper

Fixes bazel-contrib#2034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: cannot test //:authors_sorted_test with the Windows-native test wrapper
3 participants