Skip to content

Commit d71d74e

Browse files
committed
test(benchmark): testing #1394
1 parent d9fd5e4 commit d71d74e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Diff for: lab/benchmark.py

+31
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ class Coverage:
297297
# Tweaks to the .coveragerc file
298298
options: Optional[str] = None
299299

300+
class CoveragePR(Coverage):
301+
"""A version of coverage.py from a pull request."""
302+
def __init__(self, number, options=None):
303+
super().__init__(
304+
slug=f"#{number}",
305+
pip_args=f"git+https://github.com/nedbat/coveragepy.git@refs/pull/{number}/merge",
306+
options=options,
307+
)
300308

301309
@dataclasses.dataclass
302310
class Env:
@@ -421,6 +429,29 @@ def as_table_row(vals):
421429
with change_dir(PERF_DIR):
422430

423431
if 1:
432+
exp = Experiment(
433+
py_versions=[
434+
Python(3, 11),
435+
],
436+
cov_versions=[
437+
Coverage("6.4.1", "coverage==6.4.1"),
438+
CoveragePR(1394),
439+
],
440+
projects=[
441+
AdHocProject("/src/bugs/bug1339/bug1339.py"),
442+
SlipcoverBenchmark("bm_sudoku.py"),
443+
SlipcoverBenchmark("bm_spectral_norm.py"),
444+
],
445+
)
446+
exp.run(num_runs=5)
447+
exp.show_results(
448+
rows=["pyver", "proj"],
449+
column="cov",
450+
ratios=[
451+
("#1394 vs 6.4.1", "#1394", "6.4.1"),
452+
],
453+
)
454+
if 0:
424455
exp = Experiment(
425456
py_versions=[
426457
Python(3, 10),

0 commit comments

Comments
 (0)