Move sliver_utils to test/widgets to fix rendering→widgets layering#185472
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request updates sliver_utils.dart by replacing the material library import with the widgets library. A review comment identifies an architectural layering violation where the rendering layer now depends on the widgets layer and suggests moving the utility file to the widgets test directory to maintain proper repository boundaries.
|
Test exemption note: this is a no-semantic-change refactor — the file is moved between test directories and two import paths are updated, with no behavior change. The existing tests in |
|
auto label is removed for flutter/flutter/185472, Failed to enqueue flutter/flutter/185472 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected.. |
The previous commit replaced a legacy `material.dart` import in `test/rendering/sliver_utils.dart` with `widgets.dart`. Reviewer feedback flagged that a file under `test/rendering/` should not depend on the widgets layer. Since `MockSliverToBoxAdapter` extends `SingleChildRenderObjectWidget` the widgets dependency is structural. Both consumers (`sliver_main_axis_group_test.dart`, `sliver_cross_axis_group_test.dart`) already live under `test/widgets/`, so this moves the utility to sit next to them and updates the import paths. No behavior change.
bff8a78 to
22896c7
Compare
|
auto label is removed for flutter/flutter/185472, Failed to enqueue flutter/flutter/185472 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected.. |
Part of #177412
Summary
The first commit on this branch swapped a legacy
material.dartimport inpackages/flutter/test/rendering/sliver_utils.dartforwidgets.dart. Reviewer feedback (gemini-code-assist) flagged a layering concern: a file undertest/rendering/should not depend onpackage:flutter/widgets.dart.Since
MockSliverToBoxAdapterextendsSingleChildRenderObjectWidget, the widgets dependency is structural and cannot be removed. Both consumers of this utility (sliver_main_axis_group_test.dart,sliver_cross_axis_group_test.dart) already live intest/widgets/, so the second commit moves the file there and updates the import paths.Changes:
packages/flutter/test/rendering/sliver_utils.dart→packages/flutter/test/widgets/sliver_utils.dartpackages/flutter/test/widgets/sliver_main_axis_group_test.dartpackages/flutter/test/widgets/sliver_cross_axis_group_test.dartNo behavior change.
Pre-launch Checklist
///).Tests
./bin/dart analyze packages/flutter/test/widgets/sliver_utils.dart packages/flutter/test/widgets/sliver_main_axis_group_test.dart packages/flutter/test/widgets/sliver_cross_axis_group_test.dart./bin/flutter test packages/flutter/test/widgets/sliver_main_axis_group_test.dart packages/flutter/test/widgets/sliver_cross_axis_group_test.dart