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: fix rule_test and file_test (@bazel_tools//tools/build_rules:test_rules.bzl) on Windows [blocking #6622] #8203

Closed
laszlocsomor opened this issue Apr 30, 2019 · 2 comments
Assignees
Labels
area-Windows Windows-specific issues and feature requests P1 I'll work on this now. (Assignee required) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request

Comments

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Apr 30, 2019

Description of the problem / feature request:

Fix rule_test() and file_test() (in @bazel_tools//tools/build_rules:test_rules.bzl) to work without Bash, so we can test them on Windows with the native test wrapper (#6622).

Feature requests: what underlying problem are you trying to solve with this feature?

To enable #6622 with //sass/test:* in https://github.com/bazelbuild/rules_sass.

What operating system are you running Bazel on?

Windows 10

What's the output of bazel info release?

0.25.0 rc8

@jin jin added area-Windows Windows-specific issues and feature requests untriaged labels Apr 30, 2019
@laszlocsomor laszlocsomor added bazel 1.0 P2 We'll consider working on this in future. (Assignee optional) type: feature request and removed untriaged labels May 2, 2019
@laszlocsomor laszlocsomor changed the title Windows: fix rule_test and file_test (@bazel_tools//tools/build_rules:test_rules.bzl) on Windows Windows: fix rule_test and file_test (@bazel_tools//tools/build_rules:test_rules.bzl) on Windows [blocking #6622] May 2, 2019
@laszlocsomor
Copy link
Contributor Author

It's enough to change these rules into macros around sh_test.
Goal isn't to cut the Bash dependency, it is to make them work with the Bash-less test wrapper, and turning them into sh_test is sufficient.

@laszlocsomor laszlocsomor self-assigned this May 16, 2019
@laszlocsomor laszlocsomor added P1 I'll work on this now. (Assignee required) and removed P2 We'll consider working on this in future. (Assignee optional) labels May 16, 2019
@laszlocsomor
Copy link
Contributor Author

P1 because it's blocking #6622, which I really want to resolve in Bazel 0.27

laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 16, 2019
All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes bazelbuild#8203
Unblocks bazelbuild#6622
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue May 16, 2019
All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes bazelbuild#8203
Unblocks bazelbuild#6622
bazel-io pushed a commit that referenced this issue May 17, 2019
*** Reason for rollback ***

Breaks some of Google's own tests

*** Original change description ***

file_test, rule_test: now as sh_test rules

All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes #8203
Unblocks #6622

Closes #8352.

PiperOrigin-RevId: 248682341
@laszlocsomor laszlocsomor reopened this May 17, 2019
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes bazelbuild#8203
Unblocks bazelbuild#6622

Closes bazelbuild#8352.

PiperOrigin-RevId: 248680587
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
*** Reason for rollback ***

Breaks some of Google's own tests

*** Original change description ***

file_test, rule_test: now as sh_test rules

All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes bazelbuild#8203
Unblocks bazelbuild#6622

Closes bazelbuild#8352.

PiperOrigin-RevId: 248682341
irengrig pushed a commit to irengrig/bazel that referenced this issue Jun 18, 2019
This commit rolls forward commit 76583ee,
which was rolled back by commit 28f8af7.

Differences:
- test_rules.bzl:success_target and failure_target
  no longer dump 'msg' into a file and print that.
  Instead, they print it as a heredoc.
- The same functions no longer need runfiles.bash.
  The breakage the original commit caused was that
  some Starlark rule used success_target but
  itself didn't depend on the Bash runfiles
  library, and success_target returns a
  DefaultInfo without the runfiles library in it.
  To keep existing success_target and
  failure_target calls intact, I opted to remove
  the dependency on runfiles.bash
- marked all "_impl" rules as testonly=1

Original commit message follows.

All test rules in
@bazel_tools//tools/build_rule:test_rules.bzl are
now macros around sh_test.

This allows running them on Windows with the
Windows-native test wrapper.

Fixes bazelbuild#8203
Unblocks bazelbuild#6622

Closes bazelbuild#8352.

PiperOrigin-RevId: 248691640
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests P1 I'll work on this now. (Assignee required) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@jin @philwo @laszlocsomor and others