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

Add a tag for tests that only pass on Windows #4230

Closed
aj-michael opened this issue Dec 4, 2017 · 2 comments
Closed

Add a tag for tests that only pass on Windows #4230

aj-michael opened this issue Dec 4, 2017 · 2 comments

Comments

@aj-michael
Copy link
Contributor

I noticed that //third_party/def_parser:def_parser_test only works on Windows. In fact, it does not build on mac or linux. We use the "no_windows" tag to mark tests that dont work on Windows. Perhaps we should have a corresponding tag to indicate tests that only work on Windows?

This is an issue for our internal CI system which uses bazel query to determine which tests to run on mac, but currently there is no way to filter out Windows-only tests.

@laszlocsomor
Copy link
Contributor

We already have such tests, and what I usually do is using a select and running an empty test on non-Windows. This has the advantage that it does not require tags-based filtering (and that the tags are consistent across the code base), with the (in my opinion negligible) drawback that Bazel will complain that the test ran too fast for its size.

Example:

srcs = select({
"//src/conditions:windows": ["bazel_windows_test.py"],
"//src/conditions:windows_msvc": ["bazel_windows_test.py"],
"//src/conditions:windows_msys": ["bazel_windows_test.py"],
"//conditions:default": ["empty_test.py"],
}),

@aj-michael
Copy link
Contributor Author

Thanks for the tip, that sounds good. I'll close this issue since we don't intend to add the tags as I described them.

I mailed https://bazel-review.googlesource.com/c/bazel/+/25250 to add selects to def_parser_test.

bazel-io pushed a commit that referenced this issue Dec 5, 2017
See #4230.

Change-Id: Ia0125d76eb47226ad8e09829e559d636f064b369
RELNOTES: None
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

No branches or pull requests

2 participants