Skip to content

Use compact reporters by default for direct runs - #2685

Merged
natebosch merged 3 commits into
masterfrom
failures-only-default-direct-run
Jun 26, 2026
Merged

Use compact reporters by default for direct runs#2685
natebosch merged 3 commits into
masterfrom
failures-only-default-direct-run

Conversation

@natebosch

Copy link
Copy Markdown
Member

Since we cannot import dart:io for tests running on the web we
historically defaulted to the expanded reporter as the only alternative
to the compact reporter. This doesn't match most users preferences since
it makes a verbose output in all cases.

Default instead to the failures only reporter which is quieter, and add
a platform specific library to automatically switch to the compact
reporter when it's supported by both the Dart platform and the runtime
environment.

Since we cannot import `dart:io` for tests running on the web we
historically defaulted to the expanded reporter as the only alternative
to the compact reporter. This doesn't match most users preferences since
it makes a verbose output in all cases.

Default instead to the failures only reporter which is quieter, and add
a platform specific library to automatically switch to the compact
reporter when it's supported by both the Dart platform and the runtime
environment.
@natebosch
natebosch requested a review from a team as a code owner June 25, 2026 22:32
@natebosch
natebosch requested a review from jakemac53 June 25, 2026 22:32
@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

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.

// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'direct_stub.dart' if (dart.library.io) 'direct_io.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe add a comment to this library explaining what it is

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jakemac53 jakemac53 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably OK to release as non-breaking but I wouldn't be super surprised if somebody does get broken by it 🤷‍♂️

@natebosch

Copy link
Copy Markdown
Member Author

I wouldn't be super surprised if somebody does get broken by it

I think we can plan to resolve whatever comes up if it does. Overall I expect this to have little impact because most invocations use the test runner, but for the places where it does have an impact I think it's very likely to do more good than harm..

@natebosch
natebosch merged commit 4724c3e into master Jun 26, 2026
70 checks passed
@natebosch
natebosch deleted the failures-only-default-direct-run branch June 26, 2026 17:40
@dcharkes

Copy link
Copy Markdown
Contributor

I think this is probably OK to release as non-breaking but I wouldn't be super surprised if somebody does get broken by it 🤷‍♂️

Yep, broken 😆 I'll just update the tests 👍

copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Jun 29, 2026
Package:test changed to the compact reporter by default:
dart-lang/test#2685

Opt in to the verbose reporter where possible and remove test name
from the compact reporter expectations.

We resolve `package:test` via `pub get` in these test projects
(instead of pinning them to what we pull in via `DEPS`). So, these
tests are not hermetic. We could make the tests hermetic by rewriting
the pubspecs to pull in packages via DEPS in the style of
https://dart-review.googlesource.com/c/sdk/+/515600/11/pkg/dartdev/test/native_assets/helpers.dart

Closes: #63697
Change-Id: Id56e3ceba6b66b567cac3bd3e3e132ae68f6a45d
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/518360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
@DanTup

DanTup commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This really confused me - I have PowerShell aliases to run tests, one of which filters out most of the noise with Select-String and another which provided the full output, but now it isn't 😄

But, I'm in favour of the change (because now I don't need the Select-String hacks!), but I wonder if there should be an env var or something to allow forcing it back to the verbose one?

@natebosch

Copy link
Copy Markdown
Member Author

I wonder if there should be an env var or something to allow forcing it back to the verbose one?

I think it's probably a good idea for us to support more environment variables like this in the test runner in general, it makes sense to me to honor it in the direct run case as well.

#2692

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