Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "rules_mayhem",
version = "0.8.8",
version = "0.8.9",
)

bazel_dep(name = "bazel_skylib", version = "1.9.0")
Expand Down
12 changes: 6 additions & 6 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions mayhem/mayhem.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,17 @@ def _mayhem_run_impl(ctx):

# For mayhem wait
wait_args = []
show_args = []
if ctx.attr.wait:
if not ctx.attr.duration:
fail("The 'wait' attribute requires the 'duration' attribute to be set (otherwise, we will wait forever)")
wait_args.append("wait")
show_args.append("show")
if ctx.attr.owner:
wait_args.append("--owner")
wait_args.append(ctx.attr.owner)
show_args.append("--owner")
show_args.append(ctx.attr.owner)
if ctx.attr.junit:
wait_args.append("--junit")
wait_args.append(ctx.attr.junit)
Expand Down Expand Up @@ -281,6 +285,7 @@ def resolve_runfile_mayhem_cli_path(mayhem_cli_short_path):
mayhem_cli = resolve_runfile_mayhem_cli_path("{mayhem_cli}")
run_args = {run_args}
wait_args = {wait_args}
show_args = {show_args}

if "{package_basename}":
if runfiles_enabled:
Expand Down Expand Up @@ -314,7 +319,7 @@ if wait_args:
sys.exit(wait_result.returncode)

# Mayhem show
show_result = subprocess.run([mayhem_cli, "show", run_id], capture_output=True, text=True)
show_result = subprocess.run([mayhem_cli] + show_args + [run_id], capture_output=True, text=True)
print(show_result.stdout)
if show_result.returncode != 0:
print(show_result.stderr, file=sys.stderr)
Expand All @@ -326,6 +331,7 @@ if wait_args:
package_basename=package_basename,
run_args=run_args,
wait_args=wait_args,
show_args=show_args,
)

if is_windows:
Expand Down Expand Up @@ -515,4 +521,4 @@ mayhem_download = rule(
allow_single_file = True,
),
},
)
)
Loading