Skip to content

Commit 81ee9b3

Browse files
authored
include owner in show command (#20)
* include owner in show command * revert refactor * no reports for show
1 parent 4994462 commit 81ee9b3

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "rules_mayhem",
3-
version = "0.8.8",
3+
version = "0.8.9",
44
)
55

66
bazel_dep(name = "bazel_skylib", version = "1.9.0")

MODULE.bazel.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mayhem/mayhem.bzl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,17 @@ def _mayhem_run_impl(ctx):
231231

232232
# For mayhem wait
233233
wait_args = []
234+
show_args = []
234235
if ctx.attr.wait:
235236
if not ctx.attr.duration:
236237
fail("The 'wait' attribute requires the 'duration' attribute to be set (otherwise, we will wait forever)")
237238
wait_args.append("wait")
239+
show_args.append("show")
238240
if ctx.attr.owner:
239241
wait_args.append("--owner")
240242
wait_args.append(ctx.attr.owner)
243+
show_args.append("--owner")
244+
show_args.append(ctx.attr.owner)
241245
if ctx.attr.junit:
242246
wait_args.append("--junit")
243247
wait_args.append(ctx.attr.junit)
@@ -281,6 +285,7 @@ def resolve_runfile_mayhem_cli_path(mayhem_cli_short_path):
281285
mayhem_cli = resolve_runfile_mayhem_cli_path("{mayhem_cli}")
282286
run_args = {run_args}
283287
wait_args = {wait_args}
288+
show_args = {show_args}
284289
285290
if "{package_basename}":
286291
if runfiles_enabled:
@@ -314,7 +319,7 @@ if wait_args:
314319
sys.exit(wait_result.returncode)
315320
316321
# Mayhem show
317-
show_result = subprocess.run([mayhem_cli, "show", run_id], capture_output=True, text=True)
322+
show_result = subprocess.run([mayhem_cli] + show_args + [run_id], capture_output=True, text=True)
318323
print(show_result.stdout)
319324
if show_result.returncode != 0:
320325
print(show_result.stderr, file=sys.stderr)
@@ -326,6 +331,7 @@ if wait_args:
326331
package_basename=package_basename,
327332
run_args=run_args,
328333
wait_args=wait_args,
334+
show_args=show_args,
329335
)
330336

331337
if is_windows:
@@ -515,4 +521,4 @@ mayhem_download = rule(
515521
allow_single_file = True,
516522
),
517523
},
518-
)
524+
)

0 commit comments

Comments
 (0)