Skip to content

Export TestFailure from package:test_api/scaffolding.dart - #2723

Merged
auto-submit[bot] merged 4 commits into
masterfrom
expose-test-failure
Aug 18, 2026
Merged

auto-submit[bot] merged 4 commits into
masterfrom
expose-test-failure

Conversation

@kevmoo

@kevmoo kevmoo commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Re-export TestFailure in package:test_api/scaffolding.dart (which in turn
exports it in package:test/scaffolding.dart).

This allows users migrating from package:test/test.dart to
package:test/scaffolding.dart (such as when using package:checks) to
throw or handle TestFailure exceptions without needing an explicit import
of package:test_api/hooks.dart.

Closes #2073

Re-export `TestFailure` in `package:test_api/scaffolding.dart` (which in turn
exports it in `package:test/scaffolding.dart`).

This allows users migrating from `package:test/test.dart` to
`package:test/scaffolding.dart` (such as when using `package:checks`) to
throw or handle `TestFailure` exceptions without needing an explicit import
of `package:test_api/hooks.dart`.
@kevmoo
kevmoo requested a review from a team as a code owner August 13, 2026 18:42
@kevmoo
kevmoo requested a review from natebosch August 13, 2026 18:49
@github-actions

github-actions Bot commented Aug 13, 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.

Now that package:test/scaffolding.dart exports TestFailure, the explicit
imports of package:test_api/hooks.dart in pkgs/checks tests are no longer
needed and triggered unnecessary_import warnings under analysis.
@github-actions github-actions Bot added the package:checks Issues related to pkg:checks label Aug 13, 2026
By using the pre-release suffix (-wip), the checks package's dev dependency on test is properly resolved within the workspace constraint, which fixes 'mono_repo test' and ensures correct resolution before publishing.
@kevmoo

kevmoo commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

Blocked on dart-lang/sdk#64049 (MSAN crash in dartaotruntime_msan on 3.14.0-112.0.dev).

@natebosch

Copy link
Copy Markdown
Member

What's your opinion on whether we should move a copy of Never fail(String) into test/scaffolding.dart?

@natebosch

Copy link
Copy Markdown
Member

Closes #2073

@kevmoo

kevmoo commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

What's your opinion on whether we should move a copy of Never fail(String) into test/scaffolding.dart?

We can't bring it in from matcher. If we re-create it then we'll have the opportunity for a name conflict. I figured this was the easy thing to do!

@auto-submit
auto-submit Bot merged commit bbe8f9b into master Aug 18, 2026
173 of 177 checks passed
@auto-submit
auto-submit Bot deleted the expose-test-failure branch August 18, 2026 16:02
copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Sep 4, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart test`.

test (https://github.com/dart-lang/test/compare/55b186d..18ef597):
  18ef5978  Fri Sep 4 10:13:39 2026 -0700  Nate Bosch  Add support for collapsed error messages (dart-lang/test#2651)
  6783445c  Wed Sep 2 16:46:04 2026 -0700  Nate Bosch  Prepare to publish (dart-lang/test#2737)
  8de693e1  Tue Sep 1 03:54:15 2026 +0000  dependabot[bot]  Bump the github-actions group with 2 updates (dart-lang/test#2744)
  575e4dad  Mon Aug 31 17:01:46 2026 -0700  Nate Bosch  Fix deadlock waiting on serverSocket (dart-lang/test#2740)
  bd9acf32  Thu Aug 27 22:53:54 2026 -0700  Nate Bosch  Unskip a test on windows (dart-lang/test#2741)
  b575eda9  Thu Aug 27 17:16:16 2026 -0700  Nate Bosch  Remove redundant tag (dart-lang/test#2738)
  d21b06cb  Thu Aug 27 16:38:17 2026 -0700  dependabot[bot]  Bump the github-actions group across 1 directory with 5 updates (dart-lang/test#2709)
  773bc56c  Thu Aug 27 16:11:00 2026 -0700  Nate Bosch  Use read permissions in test_descriptor and test_process workflows (dart-lang/test#2736)
  73e85f1b  Wed Aug 26 06:36:41 2026 +0700  herdiyanitdev  Precompiled browser tests: stop serving files from outside the precompiled root (dart-lang/test#2724)
  bbe8f9bf  Tue Aug 18 09:02:24 2026 -0700  Kevin Moore  Export TestFailure from package:test_api/scaffolding.dart (dart-lang/test#2723)

TAG=agy
CONV=e6fd1c32-ded3-443f-83e5-2e15b4ffaccb
[email protected]

Change-Id: Iabc67d46c413470f0d2e5341e719d4edf702a94b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/546020
Commit-Queue: Nate Bosch <[email protected]>
Auto-Submit: Nate Bosch <[email protected]>
Reviewed-by: Kevin Moore <[email protected]>
Commit-Queue: Kevin Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should fail and TestFailure be exposed by scaffolding.dart?

2 participants