@@ -153,8 +153,13 @@ def run_tox(self, env, toxenv, toxargs=""):
153
153
def run_no_coverage (self , env ):
154
154
return self .run_tox (env , env .pyver .toxenv , "--skip-pkg-install" )
155
155
156
+ def run_with_coverage (self , env , pip_args , cov_options ):
157
+ self .run_tox (env , env .pyver .toxenv , "--notest" )
158
+ env .shell .run_command (f".tox/{ env .pyver .toxenv } /bin/python -m pip install { pip_args } " )
159
+ return self .run_tox (env , env .pyver .toxenv , "--skip-pkg-install" )
156
160
157
- class PytestHtml (ToxProject ):
161
+
162
+ class ProjectPytestHtml (ToxProject ):
158
163
"""pytest-dev/pytest-html"""
159
164
160
165
git_url = "https://github.com/pytest-dev/pytest-html"
@@ -172,6 +177,22 @@ def run_with_coverage(self, env, pip_args, cov_options):
172
177
env .shell .run_command (f".tox/{ covenv } /bin/python -m coverage debug sys" )
173
178
return self .run_tox (env , covenv , "--skip-pkg-install" )
174
179
180
+ class ProjectDateutil (ToxProject ):
181
+ """dateutil/dateutil"""
182
+
183
+ git_url = "https://github.com/dateutil/dateutil"
184
+
185
+ def prep_environment (self , env ):
186
+ super ().prep_environment (env )
187
+ env .shell .run_command (f"{ env .python } updatezinfo.py" )
188
+
189
+ def run_no_coverage (self , env ):
190
+ env .shell .run_command ("echo No option to run without coverage" )
191
+ return 0
192
+
193
+ class ProjectAttrs (ToxProject ):
194
+ git_url = "https://github.com/python-attrs/attrs"
195
+
175
196
176
197
class PyVersion :
177
198
# The command to run this Python
@@ -213,6 +234,7 @@ def run_experiments(
213
234
):
214
235
"""Run test suites under different conditions."""
215
236
237
+ results = []
216
238
for proj in projects :
217
239
print (f"Testing with { proj .git_url } " )
218
240
with ShellSession (f"output_{ proj .slug } .log" ) as shell :
@@ -242,9 +264,13 @@ def run_experiments(
242
264
print (f"Tests took { dur :.3f} s" )
243
265
durations .append (dur )
244
266
med = statistics .median (durations )
245
- print (
246
- f"## Median for { pyver .command } , cov={ cov_slug } : { med :.3f} s"
247
- )
267
+ result = f"Median for { proj .slug } , { pyver .command } , cov={ cov_slug } : { med :.3f} s"
268
+ print (f"## { result } " )
269
+ results .append (result )
270
+
271
+ print ("# Results" )
272
+ for result in results :
273
+ print (result )
248
274
249
275
250
276
PERF_DIR = Path ("/tmp/covperf" )
@@ -261,12 +287,13 @@ def run_experiments(
261
287
Python (3 , 10 ),
262
288
],
263
289
cov_versions = [
264
- ("none" , None , None ),
290
+ # ("none", None, None),
265
291
("6.4" , "coverage==6.4" , "" ),
266
292
("tip" , "-e ~/coverage/trunk" , "" ),
267
293
],
268
294
projects = [
269
- PytestHtml (),
295
+ ProjectPytestHtml (),
296
+ ProjectAttrs (),
270
297
],
271
298
num_runs = 5 ,
272
299
)
@@ -285,7 +312,7 @@ def run_experiments(
285
312
# ),
286
313
# ],
287
314
# projects=[
288
- # PytestHtml (),
315
+ # ProjectPytestHtml (),
289
316
# ],
290
317
# num_runs=3,
291
318
# )
0 commit comments