Skip to content

Commit

Permalink
Correctly report config failure in Zulip integration (#10)
Browse files Browse the repository at this point in the history
* Correctly report config failure in Zulip integration

* Update runbms plugin interface
  • Loading branch information
k-sareen committed Oct 19, 2021
1 parent e0563af commit 2d57190
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion running/command/runbms.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def run_one_benchmark(
p.start_invocation(hfac, bm, i)
print(i, end="", flush=True)
for j, c in enumerate(configs):
config_passed = False
for p in plugins.values():
p.start_config(hfac, bm, i, j)
if skip_oom is not None and oomed_count[c] >= skip_oom:
Expand Down Expand Up @@ -254,6 +255,7 @@ def run_one_benchmark(
print(".", end="", flush=True)
elif exit_status is SubprocessrExit.Normal:
if suite.is_passed(output):
config_passed = True
print(config_index_to_chr(j), end="", flush=True)
else:
print(".", end="", flush=True)
Expand All @@ -262,7 +264,7 @@ def run_one_benchmark(
else:
raise ValueError("Not a valid SubprocessrExit value")
for p in plugins.values():
p.end_config(hfac, bm, i, j)
p.end_config(hfac, bm, i, j, config_passed)

for p in plugins.values():
p.end_invocation(hfac, bm, i)
Expand Down
2 changes: 1 addition & 1 deletion running/plugin/runbms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def end_invocation(self, _hfac: Optional[float], _bm: "Benchmark", _invocation:
def start_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: int, _config: int):
pass

def end_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: int, _config: int):
def end_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: int, _config: int, _passed: bool):
pass


Expand Down
9 changes: 6 additions & 3 deletions running/plugin/runbms/zulip.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,15 @@ def start_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: in
if self.nop:
return

def end_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: int, config: int):
def end_config(self, _hfac: Optional[float], _bm: "Benchmark", _invocation: int, config: int, passed: bool):
if self.nop:
return
if self.last_message_id and self.last_message_content:
self.modify_message(self.last_message_content +
config_index_to_chr(config))
if passed:
self.modify_message(self.last_message_content +
config_index_to_chr(config))
else:
self.modify_message(self.last_message_content + ".")

def get_reservation_message(self) -> str:
reservation = self.moma.get_reservation()
Expand Down

0 comments on commit 2d57190

Please sign in to comment.