Skip to content

Commit

Permalink
runner: propagate 'testonly' property to sh_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
pjjw committed Jan 3, 2025
1 parent b65657f commit 4ebe79b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion def.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ def _gazelle_kwargs_prepare(name, kwargs):
visibility = kwargs.pop("visibility", None)
return name + "-runner", visibility

def gazelle(name, **kwargs):
def gazelle(name, testonly = False, **kwargs):
runner_name, visibility = _gazelle_kwargs_prepare(name, kwargs)

_gazelle_runner(
name = runner_name,
testonly = testonly,
**kwargs
)
tags_set = {t: "" for t in kwargs.pop("tags", [])}
Expand All @@ -229,6 +230,7 @@ def gazelle(name, **kwargs):
tags = tags,
srcs = [runner_name],
visibility = visibility,
testonly = testonly,
deps = ["@bazel_tools//tools/bash/runfiles"],
data = kwargs["data"] if "data" in kwargs else [],
)
Expand Down

0 comments on commit 4ebe79b

Please sign in to comment.