summaryrefslogtreecommitdiff
path: root/lab
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-06-06 08:24:53 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-06-06 08:24:53 -0400
commitd71d74ea2915af4cc8c684a2054454d0f90dbbf7 (patch)
tree9cc78fb518732f671505e4788f7c7653f336181e /lab
parentd9fd5e4c2d02cdc12c836ed0bb27cad9f9837aef (diff)
downloadpython-coveragepy-git-d71d74ea2915af4cc8c684a2054454d0f90dbbf7.tar.gz
test(benchmark): testing #1394
Diffstat (limited to 'lab')
-rw-r--r--lab/benchmark.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/lab/benchmark.py b/lab/benchmark.py
index 8bde9bf4..8e340562 100644
--- a/lab/benchmark.py
+++ b/lab/benchmark.py
@@ -297,6 +297,14 @@ class Coverage:
# Tweaks to the .coveragerc file
options: Optional[str] = None
+class CoveragePR(Coverage):
+ """A version of coverage.py from a pull request."""
+ def __init__(self, number, options=None):
+ super().__init__(
+ slug=f"#{number}",
+ pip_args=f"git+https://github.com/nedbat/coveragepy.git@refs/pull/{number}/merge",
+ options=options,
+ )
@dataclasses.dataclass
class Env:
@@ -423,6 +431,29 @@ with change_dir(PERF_DIR):
if 1:
exp = Experiment(
py_versions=[
+ Python(3, 11),
+ ],
+ cov_versions=[
+ Coverage("6.4.1", "coverage==6.4.1"),
+ CoveragePR(1394),
+ ],
+ projects=[
+ AdHocProject("/src/bugs/bug1339/bug1339.py"),
+ SlipcoverBenchmark("bm_sudoku.py"),
+ SlipcoverBenchmark("bm_spectral_norm.py"),
+ ],
+ )
+ exp.run(num_runs=5)
+ exp.show_results(
+ rows=["pyver", "proj"],
+ column="cov",
+ ratios=[
+ ("#1394 vs 6.4.1", "#1394", "6.4.1"),
+ ],
+ )
+ if 0:
+ exp = Experiment(
+ py_versions=[
Python(3, 10),
Python(3, 11),
#AdHocPython("/usr/local/cpython", "gh93493"),