Skip to content

Default failure summary for expanded reporter#2588

Merged
natebosch merged 8 commits intodart-lang:masterfrom
Telomelonia:add-compact-reporter-failure-summary
Mar 5, 2026
Merged

Default failure summary for expanded reporter#2588
natebosch merged 8 commits intodart-lang:masterfrom
Telomelonia:add-compact-reporter-failure-summary

Conversation

@Telomelonia
Copy link
Copy Markdown
Contributor

@Telomelonia Telomelonia commented Jan 27, 2026

Summary

  • Add failure_summary.dart with deterministic sorted output and (did not complete) annotations
  • Call writeFailureSummary unconditionally in the expanded reporter on failure
  • Update expanded reporter tests to expect the failure summary

@Telomelonia
Copy link
Copy Markdown
Contributor Author

The issue core problem- not knowing which tests failed is solved... the line number is a nice-to-have, needs more work maybe extracting from trace

@jakemac53
Copy link
Copy Markdown
Contributor

jakemac53 commented Jan 27, 2026

@Telomelonia I am curious specifically with the current output what is causing the output to be hard to read - is it that there are large stack traces/failure explanations for each failure?

In some sense I worry that if there are a lot of failures, this list at the bottom will now be hiding the actual reasons for failure, creating a different problem?

Maybe we should just print the first X failures at the bottom or something in the summary, followed by ... and X more or something like that.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 27, 2026

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@natebosch
Copy link
Copy Markdown
Member

When running lots of tests, the failure details scroll off screen and you're left with just +152 -6: Some tests failed. with no easy way to see what actually broke.

This is not expected in typical cases when using the compact reporter. I'd understand the utility more clearly if we were adding this to the expanded reporter.

I'm not completely opposed to the idea of adding a summary, but we should first dig a bit more on the root cause. If there are common causes of excessively long output from the compact reporter I'd be more inclined to resolve those than to patch over the long output with even more output.

Can you clarify what type of output from successful tests is causing the failures to scroll away? Or is the problem with failure output that is too tall?

@Telomelonia
Copy link
Copy Markdown
Contributor Author

@natebosch
You're right that the compact reporter shouldn't normally have this problem — the \r overwrite keeps things tight. But there are a few real-world cases where it breaks down:

  • Tests that print() — forces newlines and breaks the \r overwrite. The framework has printOnFailure() but in practice a lot of tests just use print()
  • Multiple failures with long stack traces / verbose matcher output stacking up
  • Dependency warnings flooding output — like this person who got 63 lines of warnings per test run after upgrading Flutter, and their terminal couldn't even scroll back to failures anymore

That Flutter issue is actually titled "Flutter test doesn't report the failing tests in the summary" — same ask. And it's come up here before too (#263, #554).

I also agree with your point about the expanded reporter — this problem is worse there since every update is a new line. So I'd like to extend the summary to both compact and expanded rather than just compact.
The failures-only reporter helps but changes the whole output format — I thought --summary would be lighter, you keep your normal output and just get a quick list at the end when you opt in.

@Telomelonia
Copy link
Copy Markdown
Contributor Author

Per @jakemac53's feedback I'll also cap it to the first 5 failures with "... and N more" so the summary itself doesn't get unwieldy.

@Telomelonia Telomelonia force-pushed the add-compact-reporter-failure-summary branch from 52c5c9c to 3e49572 Compare February 14, 2026 09:56
@Telomelonia Telomelonia changed the title Add -s/--summary flag to compact reporter Default failure summary for expanded reporter Feb 26, 2026
@Telomelonia Telomelonia force-pushed the add-compact-reporter-failure-summary branch from 75434f5 to 780f288 Compare February 26, 2026 14:27
@Telomelonia Telomelonia force-pushed the add-compact-reporter-failure-summary branch from 780f288 to f692111 Compare February 26, 2026 14:29
@Telomelonia
Copy link
Copy Markdown
Contributor Author

@natebosch cc: @jakemac53
I made the changes addressing the comments
I hope its much simpler and fixes problem
Please review

@Telomelonia
Copy link
Copy Markdown
Contributor Author

@natebosch
Sorry for disturbing but can you allow ci to run, it must pass now
I am skipping the changelog for now

@kevmoo
Copy link
Copy Markdown
Member

kevmoo commented Mar 3, 2026

A changelog entry would be nice here!

@Telomelonia
Copy link
Copy Markdown
Contributor Author

@kevmoo
I think ci will pass now 🤞

It looks odd to have the 1 extra failure turn into 1 extra line that
doesn't say anything about it. Instead collapse to 1 item fewer than the
max, so collapsing only happens when it will impact at least 2 failure
messages.

Add tests for the collapsing behavior.
@natebosch natebosch merged commit 746af0e into dart-lang:master Mar 5, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants