Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5d01c7

Browse filesBrowse files
authored
test: use a custom rule instead of native.filegroup for testing that PyInfo is a required provider. (bazel-contrib#1479)
Within Google, for historical reasons, the filegroup rule type is allowed in deps, which means `test_requires_pyinfo` test fails. This can be easily worked around by using a custom rule that doesn't have the same name.
1 parent 38b5ac0 commit f5d01c7
Copy full SHA for f5d01c7

File tree

1 file changed

+9
-1
lines changed
Filter options

1 file changed

+9
-1
lines changed

‎tests/base_rules/base_tests.bzl

Copy file name to clipboardExpand all lines: tests/base_rules/base_tests.bzl
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ _produces_py_info = rule(
3030
attrs = {"srcs": attr.label_list(allow_files = True)},
3131
)
3232

33+
def _not_produces_py_info_impl(ctx):
34+
_ = ctx # @unused
35+
return [DefaultInfo()]
36+
37+
_not_produces_py_info = rule(
38+
implementation = _not_produces_py_info_impl,
39+
)
40+
3341
def _test_consumes_provider(name, config):
3442
rt_util.helper_target(
3543
config.base_test_rule,
@@ -62,7 +70,7 @@ def _test_requires_provider(name, config):
6270
deps = [name + "_nopyinfo"],
6371
)
6472
rt_util.helper_target(
65-
native.filegroup,
73+
_not_produces_py_info,
6674
name = name + "_nopyinfo",
6775
)
6876
analysis_test(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.