Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set benchmark runs to error if the subprocess errors #5434

Merged
merged 4 commits into from
Aug 18, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/benchmarks_run.yml
Expand Up @@ -112,6 +112,7 @@ jobs:
gh issue create --title "$title" --body "$body" --label "Bot" --label "Type: Performance" --repo $GITHUB_REPOSITORY

- name: Upload any benchmark reports
if: success() || steps.overnight.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: benchmark_reports
Expand Down
13 changes: 9 additions & 4 deletions benchmarks/bm_runner.py
Expand Up @@ -51,6 +51,7 @@ def _subprocess_runner(args, asv=False, **kwargs):
args.insert(0, "asv")
kwargs["cwd"] = BENCHMARKS_DIR
echo(" ".join(args))
kwargs.setdefault("check", True)
return subprocess.run(args, **kwargs)


Expand Down Expand Up @@ -387,16 +388,20 @@ def func(args: argparse.Namespace) -> None:
_setup_common()

commit_range = f"{args.first_commit}^^.."
asv_command = shlex.split(ASV_HARNESS.format(posargs=commit_range))
_subprocess_runner([*asv_command, *args.asv_args], asv=True)

# git rev-list --first-parent is the command ASV uses.
git_command = shlex.split(
f"git rev-list --first-parent {commit_range}"
)
commit_string = _subprocess_runner_capture(git_command)
commit_list = commit_string.split("\n")
_asv_compare(*reversed(commit_list), overnight_mode=True)

asv_command = shlex.split(ASV_HARNESS.format(posargs=commit_range))
try:
_subprocess_runner([*asv_command, *args.asv_args], asv=True)
finally:
# Designed for long running - want to compare/post any valid
# results even if some are broken.
_asv_compare(*reversed(commit_list), overnight_mode=True)


class Branch(_SubParserGenerator):
Expand Down
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Expand Up @@ -93,6 +93,9 @@ This document explains the changes made to Iris for this release
an issue if the overnight run fails - this was previously an 'invisible'
problem. (feature branch: :pull:`5432`)

#. `@trexfeathers`_ set `bm_runner.py` to error when the called processes
error. This fixes an oversight introduced in :pull:`5215`. (feature branch:
:pull`5434`)

.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
Expand Down