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

Windows: cannot test //:authors_sorted_test with the Windows-native test wrapper #2034

Closed
laszlocsomor opened this issue Apr 18, 2019 · 0 comments · Fixed by #2035
Closed
Assignees

Comments

@laszlocsomor
Copy link
Contributor

What version of rules_go are you using?

$ git remote get-url origin
https://github.com/bazelbuild/rules_go

$ git branch
* master

$ git rev-parse HEAD
2169c127ab3791342dedb7f479151d01ca412584

What version of gazelle are you using?

C:\src\rules_go>c:\src\bazel-releases\0.25.0\rc3\bazel.exe query --output=build //external:bazel_gazelle
# C:/src/rules_go/WORKSPACE:12:1
git_repository(
  name = "bazel_gazelle",
  remote = "https://github.com/bazelbuild/bazel-gazelle",
  commit = "aa1a9cfe4845bc83482af92addbfcd41f8dc51f0",
  shallow_since = "1548631399 -0500",
)

What version of Bazel are you using?

0.25.0rc3 from https://releases.bazel.build/0.25.0/rc3/bazel-0.25.0rc3-windows-x86_64.exe

Does this issue reproduce with the latest releases of all the above?

No: the latest Bazel release (0.24.0) does not yet support the Windows-native test wrapper.

What operating system and processor architecture are you using?

Windows 10, x86_64

Any other potentially useful information about your toolchain?

What did you do?

  1. clone https://github.com/bazelbuild/rules_go/tree/2169c127ab3791342dedb7f479151d01ca412584
  2. download Bazel 0.25.0rc3 or newer

What did you expect to see?

The test to pass.

It does with --noincompatible_windows_native_test_wrapper (the default):

c:\src\bazel-releases\0.25.0\rc3\bazel.exe test --noincompatible_windows_native_test_wrapper //:authors_sorted_test --test_output=errors
(...)
//:authors_sorted_test                                                   PASSED in 2.2s

What did you see instead?

The test failed:

c:\src\bazel-releases\0.25.0\rc3\bazel.exe test --incompatible_windows_native_test_wrapper //:authors_sorted_test --test_output=errors
(...)
INFO: From Testing //:authors_sorted_test:
==================== Test output for //:authors_sorted_test:
ERROR(tools/test/windows/tw.cc:1250) value: 193 (0x000000c1): CreateProcessW failed (C:\_bazel\quoquivq\execroot\io_bazel_rules_go\bazel-out\x64_windows-fastbuild\bin\authors_sorted_test)
ERROR(tools/test/windows/tw.cc:1442) Failed to start test process "C:\_bazel\quoquivq\execroot\io_bazel_rules_go\bazel-out\x64_windows-fastbuild\bin\authors_sorted_test"
================================================================================
Target //:authors_sorted_test up-to-date:
  C:/_bazel/quoquivq/execroot/io_bazel_rules_go/bazel-out/x64_windows-fastbuild/bin/authors_sorted_test
INFO: Elapsed time: 187.892s, Critical Path: 1.04s
INFO: 4 processes: 4 local.
INFO: Build completed, 1 test FAILED, 6 total actions
//:authors_sorted_test                                                   FAILED in 0.1s
@laszlocsomor laszlocsomor self-assigned this Apr 18, 2019
jayconrod pushed a commit that referenced this issue Apr 19, 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 issue 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 issue 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 issue 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 issue 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 bazelbuild#2034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant