Skip to content
Open
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
6 changes: 4 additions & 2 deletions asv/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,14 @@ def run(
+ ")"
)

log.set_nitems(steps * max_rounds)

progress_rounds = max_rounds
if interleave_rounds:
run_round_set = [[j] for j in range(max_rounds, 0, -1)]
else:
run_round_set = [None]
if quick:
progress_rounds = 1
log.set_nitems(steps * progress_rounds)

if launch_method is None:
# Allow the users to set the launch_method by the command line argument
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/+quick_progress.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
``asv run --quick`` no longer stops the progress report short of 100%. ``--quick``
forces one round per benchmark, but the progress total was still scaled by the
benchmarks' declared ``rounds``, so a completed run capped at 50% with the default
of two rounds.
18 changes: 18 additions & 0 deletions test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,24 @@ def test_run_python_same(capsys, basic_conf):
assert "Installing" not in text


def test_run_quick_progress_completes(capsys, existing_env_conf):
tmpdir, local, conf, machine_file = existing_env_conf

tools.run_asv_with_conf(
conf,
'run',
'--quick',
'--bench=time_secondary.TimeSecondary.time_factorial',
'--bench=time_secondary.track_value',
_machine_file=join(tmpdir, 'asv-machine.json'),
)
text, err = capsys.readouterr()

# --quick forces rounds=1, so the progress total must not be scaled by the
# benchmarks' declared rounds
assert "[100.00%]" in text


def test_run_python_arg():
parser, subparsers = make_argparser()

Expand Down
Loading