Skip to content

Commit

Permalink
Pass users common attributes (such as tags) to rule_test runner
Browse files Browse the repository at this point in the history
This fix bazelbuild#8723 were the `tags` attribute was not passed to the
`_rule_test_rule` rule. This was resulting to not correctly filtered
rules when using `--build_filter_tags`.
  • Loading branch information
guibou committed Jun 26, 2019
1 parent 076ece4 commit 1571ecb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/build_rules/test_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,21 @@ _rule_test_rule = rule(
)

def rule_test(name, rule, generates = None, provides = None, **kwargs):
_rule_test_rule(
# merge the common attributes (such as `tags`, ...) provided by
# users with the attributes of _rule_test_rule
# attributes defined here (such as `testonly`) takes precedence.
rule_dict = dict(kwargs)
rule_dict.update(dict(
name = name + "_impl",
rule = rule,
generates = generates,
provides = provides,
out = name + ".sh",
testonly = 1,
visibility = ["//visibility:private"],
)
))

_rule_test_rule(**rule_dict)

_make_sh_test(name, **kwargs)

Expand Down

0 comments on commit 1571ecb

Please sign in to comment.