Skip to content

Commit ebc7489

Browse files
committed
Improve results output
1 parent bff504c commit ebc7489

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

etc/ci/report_aggregated_expected_results.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ def __init__(self, title: str, body: str, children: list[Item]):
3434
self.children = children
3535

3636
@classmethod
37-
def from_result(cls, result: dict, title_key: str = "path", title_prefix: str = "", print_stack=True):
37+
def from_result(cls, result: dict, title: Optional[str] = None, print_stack=True):
3838
expected = result["expected"]
3939
actual = result["actual"]
40-
title = result[title_key]
40+
title = title if title else result["path"]
4141
if expected != actual:
42-
title = f"{actual} [expected {expected}] {title_prefix}{title}"
42+
title = f"{actual} [expected {expected}] {title}"
4343
else:
44-
title = f"{actual} {title_prefix}{title}"
44+
title = f"{actual} {title}"
4545

4646
issue_url = "http://github.com/servo/servo/issues/"
4747
if "issues" in result and result["issues"]:
@@ -54,7 +54,10 @@ def from_result(cls, result: dict, title_key: str = "path", title_prefix: str =
5454

5555
subtest_results = result.get("unexpected_subtest_results", [])
5656
children = [
57-
cls.from_result(subtest_result, "subtest", "subtest: ", False)
57+
cls.from_result(
58+
subtest_result,
59+
f"subtest: {subtest_result['subtest']} {subtest_result.get('message', '')}",
60+
False)
5861
for subtest_result in subtest_results
5962
]
6063
return cls(title, body, children)

python/wpt/grouping_formatter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ def to_lines(result: Any[UnexpectedSubtestResult, UnexpectedResult], print_stack
9393

9494
# Test names sometimes contain control characters, which we want
9595
# to be printed in their raw form, and not their interpreted form.
96-
first_line += f" {result.path.encode('unicode-escape').decode('utf-8')}"
96+
if isinstance(result, UnexpectedSubtestResult):
97+
title = result.subtest
98+
else:
99+
title = result.path
100+
first_line += f" {title.encode('unicode-escape').decode('utf-8')}"
97101

98102
if isinstance(result, UnexpectedResult) and result.issues:
99103
first_line += f" ({', '.join([f'#{bug}' for bug in result.issues])})"

0 commit comments

Comments
 (0)