robotcode-runner 2.9.0.dev115__py3-none-any.whl → 2.9.0.dev180__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robotcode/runner/__version__.py +1 -1
- robotcode/runner/cli/_markdown.py +11 -52
- robotcode/runner/cli/discover/discover.py +3 -3
- robotcode/runner/cli/results/_compare.py +479 -0
- robotcode/runner/cli/results/_html.py +5 -5
- robotcode/runner/cli/results/_models.py +162 -0
- robotcode/runner/cli/results/_render.py +287 -18
- robotcode/runner/cli/results/results.py +661 -27
- {robotcode_runner-2.9.0.dev115.dist-info → robotcode_runner-2.9.0.dev180.dist-info}/METADATA +5 -5
- {robotcode_runner-2.9.0.dev115.dist-info → robotcode_runner-2.9.0.dev180.dist-info}/RECORD +12 -11
- {robotcode_runner-2.9.0.dev115.dist-info → robotcode_runner-2.9.0.dev180.dist-info}/WHEEL +0 -0
- {robotcode_runner-2.9.0.dev115.dist-info → robotcode_runner-2.9.0.dev180.dist-info}/entry_points.txt +0 -0
|
@@ -237,3 +237,165 @@ class DiffResult(CamelSnakeMixin):
|
|
|
237
237
|
added: Optional[List[DiffChange]] = None
|
|
238
238
|
removed: Optional[List[DiffChange]] = None
|
|
239
239
|
filters_applied: Optional[Dict[str, List[str]]] = None
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
# `compare`: every list of per-run values follows the order of `CompareResult.runs`, with `null` for a run
|
|
243
|
+
# without the item. Values that depend on the order of the runs are given per group in `per_group`, with a
|
|
244
|
+
# single group named `null` without `--group-by-metadata`.
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@dataclass
|
|
248
|
+
class CompareRun(CamelSnakeMixin):
|
|
249
|
+
number: int
|
|
250
|
+
file: ResultFileInfo
|
|
251
|
+
status: str
|
|
252
|
+
counts: Counts
|
|
253
|
+
name: Optional[str] = None
|
|
254
|
+
group: Optional[str] = None
|
|
255
|
+
start_time: Optional[str] = None
|
|
256
|
+
elapsed_seconds: Optional[float] = None
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
@dataclass
|
|
260
|
+
class CompareGroup(CamelSnakeMixin):
|
|
261
|
+
name: Optional[str]
|
|
262
|
+
runs: List[int]
|
|
263
|
+
counts: Counts
|
|
264
|
+
elapsed_seconds: Optional[float] = None
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
@dataclass
|
|
268
|
+
class CompareCell(CamelSnakeMixin):
|
|
269
|
+
counts: Counts
|
|
270
|
+
elapsed_seconds: Optional[float] = None
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
@dataclass
|
|
274
|
+
class CompareStatsGroup(CamelSnakeMixin):
|
|
275
|
+
name: str
|
|
276
|
+
runs: List[Optional[CompareCell]]
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
@dataclass
|
|
280
|
+
class CompareStatsSection(CamelSnakeMixin):
|
|
281
|
+
dimension: str # "tag" | "suite"
|
|
282
|
+
groups: List[CompareStatsGroup]
|
|
283
|
+
truncated: int = 0
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
@dataclass
|
|
287
|
+
class CompareTestGroup(CamelSnakeMixin):
|
|
288
|
+
group: Optional[str]
|
|
289
|
+
failed: int
|
|
290
|
+
runs: int
|
|
291
|
+
flaky: bool = False
|
|
292
|
+
failing_since: Optional[int] = None
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
@dataclass
|
|
296
|
+
class CompareTest(CamelSnakeMixin):
|
|
297
|
+
full_name: str
|
|
298
|
+
statuses: List[Optional[str]]
|
|
299
|
+
per_group: List[CompareTestGroup]
|
|
300
|
+
source: Optional[str] = None
|
|
301
|
+
rel_source: Optional[str] = None
|
|
302
|
+
lineno: Optional[int] = None
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
@dataclass
|
|
306
|
+
class CompareTests(CamelSnakeMixin):
|
|
307
|
+
tests: List[CompareTest]
|
|
308
|
+
truncated: int = 0
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
@dataclass
|
|
312
|
+
class CompareFailureGroup(CamelSnakeMixin):
|
|
313
|
+
group: Optional[str]
|
|
314
|
+
first_run: Optional[int] = None
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
@dataclass
|
|
318
|
+
class CompareFailure(CamelSnakeMixin):
|
|
319
|
+
message: str
|
|
320
|
+
tests: List[str]
|
|
321
|
+
runs: List[int]
|
|
322
|
+
per_group: List[CompareFailureGroup]
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
@dataclass
|
|
326
|
+
class CompareFailures(CamelSnakeMixin):
|
|
327
|
+
failures: List[CompareFailure]
|
|
328
|
+
truncated: int = 0
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
@dataclass
|
|
332
|
+
class CompareGrowth(CamelSnakeMixin):
|
|
333
|
+
full_name: str
|
|
334
|
+
group: Optional[str]
|
|
335
|
+
median_seconds: float
|
|
336
|
+
last_seconds: float
|
|
337
|
+
growth_seconds: float
|
|
338
|
+
growth_percent: Optional[float] = None
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
@dataclass
|
|
342
|
+
class CompareElapsed(CamelSnakeMixin):
|
|
343
|
+
suites: List[CompareGrowth]
|
|
344
|
+
tests: List[CompareGrowth]
|
|
345
|
+
suites_truncated: int = 0
|
|
346
|
+
tests_truncated: int = 0
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
@dataclass
|
|
350
|
+
class CompareLevelCount(CamelSnakeMixin):
|
|
351
|
+
level: str
|
|
352
|
+
runs: List[int]
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
@dataclass
|
|
356
|
+
class CompareMessageGroup(CamelSnakeMixin):
|
|
357
|
+
group: Optional[str]
|
|
358
|
+
first_run: Optional[int] = None
|
|
359
|
+
last_run: Optional[int] = None
|
|
360
|
+
new: bool = False
|
|
361
|
+
gone: bool = False
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
@dataclass
|
|
365
|
+
class CompareMessage(CamelSnakeMixin):
|
|
366
|
+
level: str
|
|
367
|
+
message: str
|
|
368
|
+
runs: List[int]
|
|
369
|
+
per_group: List[CompareMessageGroup]
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
@dataclass
|
|
373
|
+
class CompareMessages(CamelSnakeMixin):
|
|
374
|
+
counts: List[CompareLevelCount]
|
|
375
|
+
messages: List[CompareMessage]
|
|
376
|
+
truncated: int = 0
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
@dataclass
|
|
380
|
+
class CompareEnvironment(CamelSnakeMixin):
|
|
381
|
+
run: int
|
|
382
|
+
generator: Optional[str] = None
|
|
383
|
+
tool: Optional[str] = None
|
|
384
|
+
version: Optional[str] = None
|
|
385
|
+
python: Optional[str] = None
|
|
386
|
+
platform: Optional[str] = None
|
|
387
|
+
metadata: Optional[Dict[str, str]] = None
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
@dataclass
|
|
391
|
+
class CompareResult(CamelSnakeMixin):
|
|
392
|
+
runs: List[CompareRun]
|
|
393
|
+
group_by_metadata: Optional[str] = None
|
|
394
|
+
groups: Optional[List[CompareGroup]] = None
|
|
395
|
+
sections: Optional[List[CompareStatsSection]] = None
|
|
396
|
+
tests: Optional[CompareTests] = None
|
|
397
|
+
failures: Optional[CompareFailures] = None
|
|
398
|
+
elapsed: Optional[CompareElapsed] = None
|
|
399
|
+
messages: Optional[CompareMessages] = None
|
|
400
|
+
environment: Optional[List[CompareEnvironment]] = None
|
|
401
|
+
filters_applied: Optional[Dict[str, List[str]]] = None
|
|
@@ -15,7 +15,7 @@ display target.
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
from pathlib import Path
|
|
18
|
-
from typing import Callable, Dict, List, Optional, Union
|
|
18
|
+
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
|
|
19
19
|
|
|
20
20
|
from .._markdown import (
|
|
21
21
|
bold_status,
|
|
@@ -33,8 +33,13 @@ from .._markdown import (
|
|
|
33
33
|
path_paren,
|
|
34
34
|
timing_suffix,
|
|
35
35
|
)
|
|
36
|
+
from . import _compare
|
|
36
37
|
from ._models import (
|
|
37
38
|
ArtifactRef,
|
|
39
|
+
CompareGroup,
|
|
40
|
+
CompareGrowth,
|
|
41
|
+
CompareResult,
|
|
42
|
+
Counts,
|
|
38
43
|
DiffChange,
|
|
39
44
|
DiffResult,
|
|
40
45
|
LogEntry,
|
|
@@ -107,7 +112,7 @@ def _source_paren(t: _TestLike, *, full_paths: bool) -> str:
|
|
|
107
112
|
def render_summary(data: SummaryResult, *, full_paths: bool = False) -> str:
|
|
108
113
|
name = data.file.rel_source or data.file.source or "(unknown source)"
|
|
109
114
|
out: List[str] = []
|
|
110
|
-
out.append(f"# Summary
|
|
115
|
+
out.append(f"# Summary: {md_escape(name)}")
|
|
111
116
|
|
|
112
117
|
rows: List[List[str]] = [
|
|
113
118
|
["Status", bold_status(data.status)],
|
|
@@ -185,7 +190,7 @@ def render_show(
|
|
|
185
190
|
name = data.file.rel_source or data.file.source or "(unknown source)"
|
|
186
191
|
highlight = make_md_highlighter(search_substring, search_regex)
|
|
187
192
|
out: List[str] = []
|
|
188
|
-
out.append(f"# Show
|
|
193
|
+
out.append(f"# Show: {md_escape(name)}")
|
|
189
194
|
out.append("")
|
|
190
195
|
|
|
191
196
|
if not data.tests:
|
|
@@ -205,7 +210,7 @@ def render_show(
|
|
|
205
210
|
|
|
206
211
|
if data.truncated:
|
|
207
212
|
out.append("")
|
|
208
|
-
out.append(f"_
|
|
213
|
+
out.append(f"_... {data.truncated} more not shown (use `--top 0` for all)_")
|
|
209
214
|
|
|
210
215
|
out.append("")
|
|
211
216
|
out.append("## Statistics")
|
|
@@ -262,7 +267,7 @@ def render_stats(data: StatsResult) -> str:
|
|
|
262
267
|
out.append(_render_stats_table_md(section))
|
|
263
268
|
if section.truncated:
|
|
264
269
|
out.append("")
|
|
265
|
-
out.append(f"_
|
|
270
|
+
out.append(f"_... {section.truncated} more not shown (use `--top 0` for all)_")
|
|
266
271
|
|
|
267
272
|
footer = filters_footer_md(data.filters_applied)
|
|
268
273
|
if footer:
|
|
@@ -298,7 +303,7 @@ def render_diff(data: DiffResult, *, full_paths: bool = False) -> str:
|
|
|
298
303
|
baseline_label = data.baseline.rel_source or data.baseline.source or "(unknown baseline)"
|
|
299
304
|
current_label = data.current.rel_source or data.current.source or "(unknown current)"
|
|
300
305
|
out: List[str] = []
|
|
301
|
-
out.append(f"# Diff
|
|
306
|
+
out.append(f"# Diff: {md_escape(baseline_label)} -> {md_escape(current_label)}")
|
|
302
307
|
|
|
303
308
|
summary_counts: Dict[str, int] = {}
|
|
304
309
|
rendered_any = False
|
|
@@ -331,6 +336,268 @@ def render_diff(data: DiffResult, *, full_paths: bool = False) -> str:
|
|
|
331
336
|
return "\n".join(out) + "\n"
|
|
332
337
|
|
|
333
338
|
|
|
339
|
+
def _more_not_shown(truncated: int) -> str:
|
|
340
|
+
return f"_... {truncated} more not shown (use `--top 0` for all)_"
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def render_compare(data: CompareResult, *, views: Sequence[str] = (), full_paths: bool = False) -> str:
|
|
344
|
+
"""`views` gives the order of the `--show` views; the overview and the `--by` tables come first."""
|
|
345
|
+
labels = [md_escape(r.name) if r.name else f"#{r.number}" for r in data.runs]
|
|
346
|
+
label_of = {r.number: label for r, label in zip(data.runs, labels)}
|
|
347
|
+
grouped = data.groups is not None
|
|
348
|
+
group_sizes = [len(g.runs) for g in data.groups] if data.groups is not None else [len(data.runs)]
|
|
349
|
+
run_aligns = ["right"] * len(labels)
|
|
350
|
+
|
|
351
|
+
def per_group(values: List[str]) -> str:
|
|
352
|
+
empty = "-" if grouped else ""
|
|
353
|
+
return ", ".join(v or empty for v in values) if grouped else (values[0] if values else "")
|
|
354
|
+
|
|
355
|
+
def run_label(number: Optional[int]) -> str:
|
|
356
|
+
return label_of.get(number, f"#{number}") if number is not None else ""
|
|
357
|
+
|
|
358
|
+
out: List[str] = [f"# Compare: {len(data.runs)} runs"]
|
|
359
|
+
|
|
360
|
+
out += ["", "## Runs", "", _compare_runs_table(data, labels, full_paths=full_paths)]
|
|
361
|
+
|
|
362
|
+
for section in data.sections or []:
|
|
363
|
+
heading = _STATS_DIMENSION_HEADING.get(section.dimension, section.dimension.title())
|
|
364
|
+
out += ["", f"## {heading}", ""]
|
|
365
|
+
if not section.groups:
|
|
366
|
+
out.append("_(no groups matched)_")
|
|
367
|
+
continue
|
|
368
|
+
rows = [
|
|
369
|
+
[md_escape(g.name), *[f"{c.counts.failed}/{c.counts.total}" if c is not None else "-" for c in g.runs]]
|
|
370
|
+
for g in section.groups
|
|
371
|
+
]
|
|
372
|
+
out.append(md_table(["Name", *labels], rows, aligns=["left", *run_aligns]))
|
|
373
|
+
if section.truncated:
|
|
374
|
+
out += ["", _more_not_shown(section.truncated)]
|
|
375
|
+
|
|
376
|
+
head = out
|
|
377
|
+
view_sections: Dict[str, List[str]] = {}
|
|
378
|
+
|
|
379
|
+
groups_line = (
|
|
380
|
+
"_Groups: " + ", ".join(md_escape(g.name or "(none)") for g in data.groups) + "_"
|
|
381
|
+
if data.groups is not None
|
|
382
|
+
else None
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
if data.tests is not None:
|
|
386
|
+
out = view_sections["tests"] = []
|
|
387
|
+
out += ["", "## Tests", ""]
|
|
388
|
+
if groups_line:
|
|
389
|
+
out += [groups_line, ""]
|
|
390
|
+
if not data.tests.tests:
|
|
391
|
+
out.append("_No test failed in any run._")
|
|
392
|
+
else:
|
|
393
|
+
rows = []
|
|
394
|
+
for test in data.tests.tests:
|
|
395
|
+
parts, start = [], 0
|
|
396
|
+
for size in group_sizes:
|
|
397
|
+
parts.append(_compare.status_string(test.statuses[start : start + size]))
|
|
398
|
+
start += size
|
|
399
|
+
rows.append(
|
|
400
|
+
[
|
|
401
|
+
md_escape(test.full_name),
|
|
402
|
+
f"`{' '.join(parts)}`",
|
|
403
|
+
per_group([f"{g.failed}/{g.runs}" for g in test.per_group]),
|
|
404
|
+
per_group(["yes" if g.flaky else "" for g in test.per_group]),
|
|
405
|
+
per_group([run_label(g.failing_since) for g in test.per_group]),
|
|
406
|
+
]
|
|
407
|
+
)
|
|
408
|
+
out.append(
|
|
409
|
+
md_table(
|
|
410
|
+
["Test", "Status", "Failed", "Flaky", "Failing since"],
|
|
411
|
+
rows,
|
|
412
|
+
aligns=["left", "left", "right", "left", "left"],
|
|
413
|
+
)
|
|
414
|
+
)
|
|
415
|
+
if data.tests.truncated:
|
|
416
|
+
out += ["", _more_not_shown(data.tests.truncated)]
|
|
417
|
+
|
|
418
|
+
if data.failures is not None:
|
|
419
|
+
out = view_sections["failures"] = []
|
|
420
|
+
out += ["", "## Failures", ""]
|
|
421
|
+
if groups_line:
|
|
422
|
+
out += [groups_line, ""]
|
|
423
|
+
if not data.failures.failures:
|
|
424
|
+
out.append("_No failed test in any run._")
|
|
425
|
+
else:
|
|
426
|
+
rows = [
|
|
427
|
+
[
|
|
428
|
+
md_escape(" ".join(f.message.split())),
|
|
429
|
+
str(len(f.tests)),
|
|
430
|
+
per_group([run_label(g.first_run) for g in f.per_group]),
|
|
431
|
+
*[str(n) for n in f.runs],
|
|
432
|
+
]
|
|
433
|
+
for f in data.failures.failures
|
|
434
|
+
]
|
|
435
|
+
headers = ["Message", "Tests", "First", *labels]
|
|
436
|
+
out.append(md_table(headers, rows, aligns=["left", "right", "left", *run_aligns]))
|
|
437
|
+
if data.failures.truncated:
|
|
438
|
+
out += ["", _more_not_shown(data.failures.truncated)]
|
|
439
|
+
|
|
440
|
+
if data.elapsed is not None:
|
|
441
|
+
out = view_sections["elapsed"] = []
|
|
442
|
+
out += ["", "## Elapsed"]
|
|
443
|
+
for title, items, truncated in (
|
|
444
|
+
("Suites", data.elapsed.suites, data.elapsed.suites_truncated),
|
|
445
|
+
("Tests", data.elapsed.tests, data.elapsed.tests_truncated),
|
|
446
|
+
):
|
|
447
|
+
out += ["", f"### {title}", ""]
|
|
448
|
+
if not items:
|
|
449
|
+
out.append("_None got slower in the last run._")
|
|
450
|
+
continue
|
|
451
|
+
out.append(_compare_growth_table(items, grouped=grouped))
|
|
452
|
+
if truncated:
|
|
453
|
+
out += ["", _more_not_shown(truncated)]
|
|
454
|
+
|
|
455
|
+
if data.messages is not None:
|
|
456
|
+
out = view_sections["messages"] = []
|
|
457
|
+
out += ["", "## Messages", ""]
|
|
458
|
+
if groups_line:
|
|
459
|
+
out += [groups_line, ""]
|
|
460
|
+
if not data.messages.counts:
|
|
461
|
+
out.append("_No errors or warnings in any run._")
|
|
462
|
+
else:
|
|
463
|
+
out.append(
|
|
464
|
+
md_table(
|
|
465
|
+
["Level", *labels],
|
|
466
|
+
[[c.level, *[str(n) for n in c.runs]] for c in data.messages.counts],
|
|
467
|
+
aligns=["left", *run_aligns],
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
rows = [
|
|
471
|
+
[
|
|
472
|
+
m.level,
|
|
473
|
+
md_escape(" ".join(m.message.split())),
|
|
474
|
+
per_group([run_label(g.first_run) for g in m.per_group]),
|
|
475
|
+
per_group([run_label(g.last_run) for g in m.per_group]),
|
|
476
|
+
per_group(["new" if g.new else "gone" if g.gone else "" for g in m.per_group]),
|
|
477
|
+
*[str(n) for n in m.runs],
|
|
478
|
+
]
|
|
479
|
+
for m in data.messages.messages
|
|
480
|
+
]
|
|
481
|
+
out += [
|
|
482
|
+
"",
|
|
483
|
+
md_table(
|
|
484
|
+
["Level", "Message", "First", "Last", "Change", *labels],
|
|
485
|
+
rows,
|
|
486
|
+
aligns=["left", "left", "left", "left", "left", *run_aligns],
|
|
487
|
+
),
|
|
488
|
+
]
|
|
489
|
+
if data.messages.truncated:
|
|
490
|
+
out += ["", _more_not_shown(data.messages.truncated)]
|
|
491
|
+
|
|
492
|
+
if data.environment is not None:
|
|
493
|
+
out = view_sections["environment"] = []
|
|
494
|
+
out += ["", "## Environment", ""]
|
|
495
|
+
names: List[str] = []
|
|
496
|
+
for env in data.environment:
|
|
497
|
+
for name in env.metadata or {}:
|
|
498
|
+
if name not in names:
|
|
499
|
+
names.append(name)
|
|
500
|
+
rows = [
|
|
501
|
+
[
|
|
502
|
+
label_of.get(env.run, f"#{env.run}"),
|
|
503
|
+
md_escape(" ".join(v for v in (env.tool, env.version) if v)),
|
|
504
|
+
env.python or "",
|
|
505
|
+
md_escape(env.platform or ""),
|
|
506
|
+
*[md_escape((env.metadata or {}).get(name, "")) for name in names],
|
|
507
|
+
]
|
|
508
|
+
for env in data.environment
|
|
509
|
+
]
|
|
510
|
+
out.append(md_table(["Run", "Written by", "Python", "OS", *[md_escape(n) for n in names]], rows))
|
|
511
|
+
|
|
512
|
+
out = head
|
|
513
|
+
for view in [*views, *(v for v in view_sections if v not in views)]:
|
|
514
|
+
out += view_sections.get(view, [])
|
|
515
|
+
|
|
516
|
+
footer = filters_footer_md(data.filters_applied)
|
|
517
|
+
if footer:
|
|
518
|
+
out += ["", footer]
|
|
519
|
+
|
|
520
|
+
return "\n".join(out) + "\n"
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
def _compare_runs_table(data: CompareResult, labels: List[str], *, full_paths: bool) -> str:
|
|
524
|
+
named = any(r.name for r in data.runs)
|
|
525
|
+
grouped = data.groups is not None
|
|
526
|
+
headers = ["#", *(["Group"] if grouped else []), *(["Name"] if named else []), "Run", "Started"]
|
|
527
|
+
headers += ["Tests", "Pass", "Fail", "Skip", "Elapsed"]
|
|
528
|
+
|
|
529
|
+
def row(
|
|
530
|
+
number: str, group: str, name: str, path: str, started: str, counts: Counts, elapsed: Optional[float]
|
|
531
|
+
) -> List[str]:
|
|
532
|
+
return [
|
|
533
|
+
number,
|
|
534
|
+
*([group] if grouped else []),
|
|
535
|
+
*([name] if named else []),
|
|
536
|
+
path,
|
|
537
|
+
started,
|
|
538
|
+
str(counts.total),
|
|
539
|
+
str(counts.passed),
|
|
540
|
+
str(counts.failed),
|
|
541
|
+
str(counts.skipped),
|
|
542
|
+
fmt_elapsed(elapsed) if elapsed is not None else "",
|
|
543
|
+
]
|
|
544
|
+
|
|
545
|
+
by_number = {r.number: r for r in data.runs}
|
|
546
|
+
rows: List[List[str]] = []
|
|
547
|
+
sections: List[Tuple[List[int], Optional[str], Optional[CompareGroup]]] = (
|
|
548
|
+
[(g.runs, g.name, g) for g in data.groups]
|
|
549
|
+
if data.groups is not None
|
|
550
|
+
else [([r.number for r in data.runs], None, None)]
|
|
551
|
+
)
|
|
552
|
+
for group_runs, group_name, total in sections:
|
|
553
|
+
for number in group_runs:
|
|
554
|
+
r = by_number[number]
|
|
555
|
+
path = r.file.source if full_paths else (r.file.rel_source or r.file.source)
|
|
556
|
+
rows.append(
|
|
557
|
+
row(
|
|
558
|
+
f"#{r.number}",
|
|
559
|
+
md_escape(group_name or "(none)"),
|
|
560
|
+
md_escape(r.name or ""),
|
|
561
|
+
md_escape(path),
|
|
562
|
+
fmt_timestamp(r.start_time),
|
|
563
|
+
r.counts,
|
|
564
|
+
r.elapsed_seconds,
|
|
565
|
+
)
|
|
566
|
+
)
|
|
567
|
+
if total is not None:
|
|
568
|
+
rows.append(
|
|
569
|
+
row(
|
|
570
|
+
"",
|
|
571
|
+
f"**{md_escape(group_name or '(none)')}**",
|
|
572
|
+
"",
|
|
573
|
+
"_total_",
|
|
574
|
+
"",
|
|
575
|
+
total.counts,
|
|
576
|
+
total.elapsed_seconds,
|
|
577
|
+
)
|
|
578
|
+
)
|
|
579
|
+
aligns = ["right", *(["left"] if grouped else []), *(["left"] if named else []), "left", "left"]
|
|
580
|
+
aligns += ["right"] * 5
|
|
581
|
+
return md_table(headers, rows, aligns=aligns)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def _compare_growth_table(items: List[CompareGrowth], *, grouped: bool) -> str:
|
|
585
|
+
rows = [
|
|
586
|
+
[
|
|
587
|
+
md_escape(g.full_name),
|
|
588
|
+
*([md_escape(g.group or "(none)")] if grouped else []),
|
|
589
|
+
fmt_elapsed(g.median_seconds),
|
|
590
|
+
fmt_elapsed(g.last_seconds),
|
|
591
|
+
"+" + fmt_elapsed(g.growth_seconds),
|
|
592
|
+
f"+{g.growth_percent:.0f} %" if g.growth_percent is not None else "",
|
|
593
|
+
]
|
|
594
|
+
for g in items
|
|
595
|
+
]
|
|
596
|
+
headers = ["Name", *(["Group"] if grouped else []), "Median before", "Last", "Growth", "Growth %"]
|
|
597
|
+
aligns = ["left", *(["left"] if grouped else []), "right", "right", "right", "right"]
|
|
598
|
+
return md_table(headers, rows, aligns=aligns)
|
|
599
|
+
|
|
600
|
+
|
|
334
601
|
def _render_diff_change_md(change: DiffChange, *, full_paths: bool) -> str:
|
|
335
602
|
name = md_escape(change.full_name)
|
|
336
603
|
paren = path_paren(
|
|
@@ -342,11 +609,11 @@ def _render_diff_change_md(change: DiffChange, *, full_paths: bool) -> str:
|
|
|
342
609
|
head = f"- {name}{paren}"
|
|
343
610
|
|
|
344
611
|
if change.baseline_status and change.current_status:
|
|
345
|
-
head += f"
|
|
612
|
+
head += f" - {bold_status(change.baseline_status)} -> {bold_status(change.current_status)}"
|
|
346
613
|
elif change.current_status:
|
|
347
|
-
head += f"
|
|
614
|
+
head += f" - {bold_status(change.current_status)}"
|
|
348
615
|
elif change.baseline_status:
|
|
349
|
-
head += f"
|
|
616
|
+
head += f" - {bold_status(change.baseline_status)}"
|
|
350
617
|
|
|
351
618
|
parts = [head]
|
|
352
619
|
msg = change.current_message or change.baseline_message
|
|
@@ -390,14 +657,18 @@ def render_log(
|
|
|
390
657
|
out.append("_(no tests matched)_")
|
|
391
658
|
return "\n".join(out) + "\n"
|
|
392
659
|
|
|
393
|
-
|
|
660
|
+
suites_to_show = iter(data.suites or [])
|
|
394
661
|
current_suite: Optional[str] = object() # type: ignore[assignment]
|
|
395
662
|
|
|
396
663
|
for t in data.tests:
|
|
397
664
|
if with_suite_info and t.suite != current_suite:
|
|
398
665
|
current_suite = t.suite
|
|
399
|
-
|
|
400
|
-
|
|
666
|
+
# The suites come in the order of the run, so what comes up to a test's suite are those above it.
|
|
667
|
+
for suite in suites_to_show:
|
|
668
|
+
out.append("")
|
|
669
|
+
out.append(_render_suite_header_md(suite, full_paths=full_paths))
|
|
670
|
+
if suite.full_name == t.suite:
|
|
671
|
+
break
|
|
401
672
|
|
|
402
673
|
out.append("")
|
|
403
674
|
out.append(_test_header_md(t, full_paths=full_paths, show_timing=show_timing, highlight=highlight))
|
|
@@ -444,7 +715,7 @@ def render_log(
|
|
|
444
715
|
|
|
445
716
|
if data.extract_dir and data.extracted_count:
|
|
446
717
|
out.append("")
|
|
447
|
-
out.append(f"_Extracted:_ {data.extracted_count} artefact(s)
|
|
718
|
+
out.append(f"_Extracted:_ {data.extracted_count} artefact(s) -> `{data.extract_dir}`")
|
|
448
719
|
|
|
449
720
|
if show_timing and (data.start_time or data.end_time or data.elapsed_seconds is not None):
|
|
450
721
|
rows: List[List[str]] = []
|
|
@@ -465,9 +736,7 @@ def render_log(
|
|
|
465
736
|
return "\n".join(out) + "\n"
|
|
466
737
|
|
|
467
738
|
|
|
468
|
-
def _render_suite_header_md(suite:
|
|
469
|
-
if suite is None:
|
|
470
|
-
return ""
|
|
739
|
+
def _render_suite_header_md(suite: LogSuite, *, full_paths: bool) -> str:
|
|
471
740
|
head = f"## Suite: {md_escape(suite.full_name)}"
|
|
472
741
|
head += path_paren(source=suite.source, rel_source=suite.rel_source, lineno=None, full_paths=full_paths)
|
|
473
742
|
if suite.status:
|
|
@@ -585,7 +854,7 @@ def _emit_entry(
|
|
|
585
854
|
if is_call and max_depth > 0 and new_kw_depth >= max_depth:
|
|
586
855
|
hidden = _count_hidden(entry.body)
|
|
587
856
|
if hidden:
|
|
588
|
-
out.append(f"{cont}- _
|
|
857
|
+
out.append(f"{cont}- _... {hidden} hidden (`--max-depth {max_depth}`)_")
|
|
589
858
|
return
|
|
590
859
|
|
|
591
860
|
_emit_entries(
|
|
@@ -825,7 +1094,7 @@ def _emit_artifacts(
|
|
|
825
1094
|
if ref.embedded:
|
|
826
1095
|
size = f", {fmt_bytes(ref.approx_bytes)}" if ref.approx_bytes is not None else ""
|
|
827
1096
|
mt = f"{ref.media_type or ref.kind}{size}"
|
|
828
|
-
out.append(f"{indent}- {kind_label}: _embedded {mt}
|
|
1097
|
+
out.append(f"{indent}- {kind_label}: _embedded {mt} - use `--extract` to save_")
|
|
829
1098
|
else:
|
|
830
1099
|
out.append(f"{indent}- {kind_label}: `{ref.src}` _(unresolved)_")
|
|
831
1100
|
continue
|