forked from platformio/platformio-core
Show list of failed tests in the summary // Resolve #4251
This commit is contained in:
1 parent
0849e5faad
commit
b12d9f62b9
2 files changed
+27
-1
No files matched your search
@@ -48,6 +48,11 @@ class StdoutTestReport(TestReportBase):
|
||||
)
|
||||
|
||||
if tabular_data:
|
||||
util.print_labeled_bar(
|
||||
"SUMMARY",
|
||||
is_error=is_error,
|
||||
fg="red" if is_error else "green",
|
||||
)
|
||||
click.echo(
|
||||
tabulate(
|
||||
tabular_data,
|
||||
@@ -59,6 +64,9 @@ class StdoutTestReport(TestReportBase):
|
||||
err=is_error,
|
||||
)
|
||||
|
||||
if failed_nums:
|
||||
self.print_failed_test_cases()
|
||||
|
||||
util.print_labeled_bar(
|
||||
"%d test cases: %s%s%d succeeded in %s"
|
||||
% (
|
||||
@@ -71,3 +79,21 @@ class StdoutTestReport(TestReportBase):
|
||||
is_error=is_error,
|
||||
fg="red" if is_error else "green",
|
||||
)
|
||||
|
||||
def print_failed_test_cases(self):
|
||||
click.echo()
|
||||
for test_suite in self.test_result.suites:
|
||||
if test_suite.status != TestStatus.FAILED:
|
||||
continue
|
||||
util.print_labeled_bar(
|
||||
click.style(
|
||||
f"{test_suite.env_name}:{test_suite.test_name}", bold=True, fg="red"
|
||||
),
|
||||
is_error=True,
|
||||
sep="_",
|
||||
)
|
||||
for test_case in test_suite.cases:
|
||||
if test_case.status != TestStatus.FAILED:
|
||||
continue
|
||||
click.echo(test_case.stdout)
|
||||
click.echo()
|
||||
Reference in new issue
Block a user