Sitelet https://github.com/flutter/packages/pull/12664
Skip to content

[cupertino_ui, material_ui] Use range matchers instead of exact positions in scroll tests - #12664

Merged
auto-submit[bot] merged 5 commits into
flutter:mainfrom
dkwingsmt:loosen-rubberband
Aug 28, 2026
Merged

auto-submit[bot] merged 5 commits into
flutter:mainfrom
dkwingsmt:loosen-rubberband

Conversation

@dkwingsmt

Copy link
Copy Markdown
Contributor

Relaxes overly strict position assertions in cupertino_ui and material_ui tests by replacing hardcoded floating-point numbers with range matchers (inExclusiveRange) and relative assertions.

This avoids coupling tests to exact simulation values when underlying scroll physics change while still verifying that intermediate and final states behave as expected.

This PR unblocks flutter/flutter#187568 .

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 27, 2026
@github-actions github-actions Bot added p: cupertino_ui p: material_ui triage-design Should be looked at in design triage labels Aug 27, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors tests in refresh_test.dart and sliver_app_bar.4_test.dart by replacing platform-specific conditional checks and exact floating-point assertions with range-based assertions using inExclusiveRange. The review feedback suggests using moreOrLessEquals instead of exact equality when comparing floating-point layout dimensions and offsets to prevent potential test flakiness.

Comment thread packages/cupertino_ui/test/refresh_test.dart
Comment thread packages/cupertino_ui/test/refresh_test.dart Outdated
Comment thread packages/cupertino_ui/test/refresh_test.dart Outdated
@@ -0,0 +1,3 @@
changelog: |

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.

Since these are all test changes, I do not think we need a changelog entry.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

That's what the override labels are for. :) I'll add them. It should allow the check to pass.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you!

@Piinks Piinks added override: no versioning needed Override the check requiring version bumps for most changes override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Aug 27, 2026
@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 28, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 28, 2026
@auto-submit

auto-submit Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/packages/12664, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 28, 2026
@auto-submit
auto-submit Bot merged commit 1dd4366 into flutter:main Aug 28, 2026
11 of 13 checks passed
pull Bot pushed a commit to fucheng-guo-sun/flutter that referenced this pull request Aug 31, 2026
…r#192063)

flutter/packages@cd4cdd0...d642322

2026-08-30 engine-flutter-autoroll@skia.org Roll Flutter from
8d8c1aa to c978386 (20 revisions) (flutter/packages#12693)
2026-08-28 katelovett@google.com [ci] Update labeler
(flutter/packages#12636)
2026-08-28 269567208+reidbaker-agent@users.noreply.github.com
[camera_android_camerax] Update skills_lint to published version ^0.5.1
(flutter/packages#12684)
2026-08-28 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
6b182d2 to d3b14c8 (1391 revisions) (flutter/packages#12678)
2026-08-28 269567208+reidbaker-agent@users.noreply.github.com
[camera_android_camerax] Add presubmit sweep, cross-platform paths, and
test diff guidelines to AGENTS.md (flutter/packages#12668)
2026-08-28 engine-flutter-autoroll@skia.org Roll Flutter from
e8dca90 to 8d8c1aa (27 revisions) (flutter/packages#12679)
2026-08-28 dkwingsmt@users.noreply.github.com [cupertino_ui,
material_ui] Use range matchers instead of exact positions in scroll
tests (flutter/packages#12664)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…ions in scroll tests (flutter#12664)

Relaxes overly strict position assertions in `cupertino_ui` and `material_ui` tests by replacing hardcoded floating-point numbers with range matchers (`inExclusiveRange`) and relative assertions.

This avoids coupling tests to exact simulation values when underlying scroll physics change while still verifying that intermediate and final states behave as expected.

This PR unblocks flutter/flutter#187568 .

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
victorsanni pushed a commit to victorsanni/packages that referenced this pull request Sep 9, 2026
…ions in scroll tests (flutter#12664)

Relaxes overly strict position assertions in `cupertino_ui` and `material_ui` tests by replacing hardcoded floating-point numbers with range matchers (`inExclusiveRange`) and relative assertions.

This avoids coupling tests to exact simulation values when underlying scroll physics change while still verifying that intermediate and final states behave as expected.

This PR unblocks flutter/flutter#187568 .

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: cupertino_ui p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants