Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BottomNavigationBar tests for M3 #136624

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Oct 16, 2023

This PR updates BottomNavigationBar unit tests for M3 migration.

More info in #127064

It was somewhat complex because existing tests relied on a lot of magic numbers.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Oct 16, 2023
@bleroux bleroux force-pushed the update_bottom_navigation_bar_test_for_M3 branch from e9d0a7d to ef360ed Compare October 16, 2023 09:03
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha ef360ed6c581b2d40080606bd93c07aa4930fc8e

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Oct 16, 2023
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

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

LGTM

@bleroux bleroux force-pushed the update_bottom_navigation_bar_test_for_M3 branch from ef360ed to fe67729 Compare October 19, 2023 08:04
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha fe67729ed84cb61e18c2ce4ecbda082f61d23b2a

final double firstItemLeft = itemFullWith / 2 - firstItemContentWidth / 2;
final double secondLabelWidth = tester.getSize(find.text('Title1')).width;
final double secondItemContentWidth = iconWidth + separatorWidth + secondLabelWidth;
final double secondItemLeft = itemFullWith + itemFullWith / 2 - secondItemContentWidth / 2; //const double firstLabelCenter = firstItemLeft + itemWidth / 2; // 250
Copy link
Contributor

@Piinks Piinks Nov 3, 2023

Choose a reason for hiding this comment

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

Nit: Looks like some extra commented out code

Suggested change
final double secondItemLeft = itemFullWith + itemFullWith / 2 - secondItemContentWidth / 2; //const double firstLabelCenter = firstItemLeft + itemWidth / 2; // 250
final double secondItemLeft = itemFullWith + itemFullWith / 2 - secondItemContentWidth / 2;

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I was hoping I could commit this, but it appears the PR does not have permissions enabled for me to edit it. Pushing a new commit (not force pushing, and not rebasing) would fix the Gold issue here as well.

Copy link
Contributor Author

@bleroux bleroux Nov 6, 2023

Choose a reason for hiding this comment

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

Good catch for the extra comment! 👍

(not force pushing, and not rebasing)

Thanks for your help.
I tried doing so but there were several tests failures (this PR was far from the tip of the tree, the failures were related to some changes on the CI configuration on Mac).

Let see how it goes after the rebase, I will try to use my new Gold tool knowledge 😄 and I will ask for your help if the PR is still stuck.

@bleroux bleroux force-pushed the update_bottom_navigation_bar_test_for_M3 branch from 8c76723 to 501261f Compare November 6, 2023 07:48
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha 501261f

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha f8def8f

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha d7ce91a

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #136624 at sha 9b6a8b4

@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2023
@auto-submit auto-submit bot merged commit 59d4d76 into flutter:master Nov 6, 2023
67 checks passed
@bleroux bleroux deleted the update_bottom_navigation_bar_test_for_M3 branch November 6, 2023 15:19
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 6, 2023
@TahaTesser TahaTesser restored the update_bottom_navigation_bar_test_for_M3 branch November 6, 2023 15:58
@HansMuller HansMuller added the revert Autorevert PR (with "Reason for revert:" comment) label Nov 6, 2023
@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Nov 6, 2023
auto-submit bot pushed a commit that referenced this pull request Nov 6, 2023
@HansMuller
Copy link
Contributor

HansMuller commented Nov 6, 2023

@bleroux - I'm reverting this PR because the build is currently red due to Skia Gold received an unapproved image in post-submit errors. For example:

01:16 +2402 ~4: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/bottom_navigation_bar_test.dart: Material3 - BottomNavigationBar shifting backgroundColor with transition pump 5
0.1s
 ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
0.1s
 The following SkiaException was thrown while running async test code:
0.1s
 Skia Gold received an unapproved image in post-submit
0.1s
 testing. Golden file images in flutter/flutter are triaged
0.1s
 in pre-submit during code review for the given PR.

auto-submit bot added a commit that referenced this pull request Nov 6, 2023
Reverts #136624
Initiated by: HansMuller
This change reverts the following previous change:
Original Description:
This PR updates `BottomNavigationBar` unit tests for M3 migration.

More info in #127064

It was somewhat complex because existing tests relied on a lot of magic numbers.
@HansMuller
Copy link
Contributor

@bleroux , @Piinks - I'm not sure what's going wrong here, the links from Gold, like #136624 (comment), don't appear to contain any diffs?

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 6, 2023
@Piinks
Copy link
Contributor

Piinks commented Nov 6, 2023

The images were waiting to be approved at https://flutter-gold.skia.org/
For future gardening, please check there first. The image can be approved and the test can be rerun to fix the tree.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 6, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 6, 2023
Roll Flutter from 29b25165cab8 to f5a983535131 (101 revisions)

flutter/flutter@29b2516...f5a9835

2023-11-06 gspencergoog@users.noreply.github.com Check sample links for malformed links (flutter/flutter#137807)
2023-11-06 iinozemtsev@google.com Change cast in json parsing (flutter/flutter#137708)
2023-11-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Update BottomNavigationBar tests for M3" (flutter/flutter#137948)
2023-11-06 engine-flutter-autoroll@skia.org Roll Packages from cccf5d2 to 49eac1f (2 revisions) (flutter/flutter#137943)
2023-11-06 leroux_bruno@yahoo.fr Update BottomNavigationBar tests for M3 (flutter/flutter#136624)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4f6ed31bd8bd to bdfa8aa8f81f (1 revision) (flutter/flutter#137941)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from b9b3269b0b2c to 4f6ed31bd8bd (2 revisions) (flutter/flutter#137935)
2023-11-06 tessertaha@gmail.com Provide a helpful error message when `ColorScheme.brightness` doesn't match `ThemeData.brightness` (flutter/flutter#137611)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 555ffa17b55c to b9b3269b0b2c (1 revision) (flutter/flutter#137933)
2023-11-06 andrewrkolos@gmail.com Fix tool exit message shown when user provides a non-list to "assets" for a deferred component (flutter/flutter#137837)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0d8c7ceacc01 to 555ffa17b55c (1 revision) (flutter/flutter#137921)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 11d66db97d3f to 0d8c7ceacc01 (1 revision) (flutter/flutter#137920)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from a7592e42464c to 11d66db97d3f (1 revision) (flutter/flutter#137914)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1c6bd97e2288 to a7592e42464c (1 revision) (flutter/flutter#137912)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from daf18fe46b72 to 1c6bd97e2288 (1 revision) (flutter/flutter#137908)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from a45e679828e6 to daf18fe46b72 (1 revision) (flutter/flutter#137904)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from fb2a9c20141e to a45e679828e6 (1 revision) (flutter/flutter#137903)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 576833873c15 to fb2a9c20141e (1 revision) (flutter/flutter#137900)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 25f5e285f874 to 576833873c15 (1 revision) (flutter/flutter#137898)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7282a5d94ab6 to 25f5e285f874 (2 revisions) (flutter/flutter#137892)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from b66a87626300 to 7282a5d94ab6 (2 revisions) (flutter/flutter#137887)
2023-11-04 sokolovskyi.konstantin@gmail.com HeroController should dispatch creation and disposal events. (flutter/flutter#137835)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from ec20731de6ff to b66a87626300 (1 revision) (flutter/flutter#137877)
2023-11-03 thesonerik@gmail.com InheritedElement.removeDependent() (flutter/flutter#129210)
2023-11-03 goderbauer@google.com Remove unused generic type from BottomSheet (flutter/flutter#137791)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 035740c1f90e to ec20731de6ff (2 revisions) (flutter/flutter#137872)
2023-11-03 dacoharkes@google.com Pin dart-lang/native dependencies (flutter/flutter#137601)
2023-11-03 chris@bracken.jp Send caret rect to embedder on selection update (flutter/flutter#137863)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 677040f10f65 to 035740c1f90e (4 revisions) (flutter/flutter#137871)
2023-11-03 cbobbe@zulip.com Tooltip docs: Recommend setting preferBelow to false in theme (flutter/flutter#135879)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from f363a6e5e093 to 677040f10f65 (2 revisions) (flutter/flutter#137861)
2023-11-03 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Android] Support Android 34" (flutter/flutter#137865)
2023-11-03 sokolovskyi.konstantin@gmail.com InkFeature should dispatch creation and disposal events. (flutter/flutter#137793)
2023-11-03 sokolovskyi.konstantin@gmail.com AppLifecycleListener should dispatch creation and disposal events. (flutter/flutter#137840)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d5ccb5b1b706 to f363a6e5e093 (2 revisions) (flutter/flutter#137858)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 72262a238090 to d5ccb5b1b706 (3 revisions) (flutter/flutter#137857)
2023-11-03 hans.muller@gmail.com Updated the nested navigation NavigationBar example (flutter/flutter#137788)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0415a4f5e2a2 to 72262a238090 (2 revisions) (flutter/flutter#137853)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8531c5935356 to 0415a4f5e2a2 (1 revision) (flutter/flutter#137847)
2023-11-03 jonahwilliams@google.com Roll flutter gallery version forward. (flutter/flutter#137846)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 43653c5a3ec8 to 8531c5935356 (1 revision) (flutter/flutter#137845)
2023-11-03 engine-flutter-autoroll@skia.org Roll Packages from 33c2b4e to cccf5d2 (6 revisions) (flutter/flutter#137841)
2023-11-03 matej.knopp@gmail.com [web] dispatch corresponding keyup events in text editing integrations (flutter/flutter#136874)
2023-11-03 41873024+droidbg@users.noreply.github.com [leak-tracking] Add more leak tracking in test/painting #3 (flutter/flutter#136170)
2023-11-03 polinach@google.com Upgrade leak_tracker and remove some deps in allow list. (flutter/flutter#137806)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from fc7c3f70c076 to 43653c5a3ec8 (1 revision) (flutter/flutter#137827)
...
@bleroux bleroux deleted the update_bottom_navigation_bar_test_for_M3 branch November 7, 2023 07:25
auto-submit bot pushed a commit that referenced this pull request Nov 20, 2023
This is a reland of #136624 which was reverted because one new M3 golden test failed. The failure was related to the ink sparkle animation.

Ink sparkle is the M3 default animation, it does not play well with golden because it introduces an element of randomness.
One way to avoid this randomness is to use the `InkSparkle.constantTurbulenceSeedSplashFactory`.

This PR has two commits:
- the first one is the original PR (#136624).
- the second one updates the failing test using `InkSparkle.constantTurbulenceSeedSplashFactory`.
Markzipan pushed a commit to Markzipan/flutter that referenced this pull request Nov 27, 2023
This is a reland of flutter#136624 which was reverted because one new M3 golden test failed. The failure was related to the ink sparkle animation.

Ink sparkle is the M3 default animation, it does not play well with golden because it introduces an element of randomness.
One way to avoid this randomness is to use the `InkSparkle.constantTurbulenceSeedSplashFactory`.

This PR has two commits:
- the first one is the original PR (flutter#136624).
- the second one updates the failing test using `InkSparkle.constantTurbulenceSeedSplashFactory`.
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
…er#5341)

Roll Flutter from 29b25165cab8 to f5a983535131 (101 revisions)

flutter/flutter@29b2516...f5a9835

2023-11-06 gspencergoog@users.noreply.github.com Check sample links for malformed links (flutter/flutter#137807)
2023-11-06 iinozemtsev@google.com Change cast in json parsing (flutter/flutter#137708)
2023-11-06 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Update BottomNavigationBar tests for M3" (flutter/flutter#137948)
2023-11-06 engine-flutter-autoroll@skia.org Roll Packages from cccf5d2 to 49eac1f (2 revisions) (flutter/flutter#137943)
2023-11-06 leroux_bruno@yahoo.fr Update BottomNavigationBar tests for M3 (flutter/flutter#136624)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 4f6ed31bd8bd to bdfa8aa8f81f (1 revision) (flutter/flutter#137941)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from b9b3269b0b2c to 4f6ed31bd8bd (2 revisions) (flutter/flutter#137935)
2023-11-06 tessertaha@gmail.com Provide a helpful error message when `ColorScheme.brightness` doesn't match `ThemeData.brightness` (flutter/flutter#137611)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 555ffa17b55c to b9b3269b0b2c (1 revision) (flutter/flutter#137933)
2023-11-06 andrewrkolos@gmail.com Fix tool exit message shown when user provides a non-list to "assets" for a deferred component (flutter/flutter#137837)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0d8c7ceacc01 to 555ffa17b55c (1 revision) (flutter/flutter#137921)
2023-11-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from 11d66db97d3f to 0d8c7ceacc01 (1 revision) (flutter/flutter#137920)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from a7592e42464c to 11d66db97d3f (1 revision) (flutter/flutter#137914)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1c6bd97e2288 to a7592e42464c (1 revision) (flutter/flutter#137912)
2023-11-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from daf18fe46b72 to 1c6bd97e2288 (1 revision) (flutter/flutter#137908)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from a45e679828e6 to daf18fe46b72 (1 revision) (flutter/flutter#137904)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from fb2a9c20141e to a45e679828e6 (1 revision) (flutter/flutter#137903)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 576833873c15 to fb2a9c20141e (1 revision) (flutter/flutter#137900)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 25f5e285f874 to 576833873c15 (1 revision) (flutter/flutter#137898)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from 7282a5d94ab6 to 25f5e285f874 (2 revisions) (flutter/flutter#137892)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from b66a87626300 to 7282a5d94ab6 (2 revisions) (flutter/flutter#137887)
2023-11-04 sokolovskyi.konstantin@gmail.com HeroController should dispatch creation and disposal events. (flutter/flutter#137835)
2023-11-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from ec20731de6ff to b66a87626300 (1 revision) (flutter/flutter#137877)
2023-11-03 thesonerik@gmail.com InheritedElement.removeDependent() (flutter/flutter#129210)
2023-11-03 goderbauer@google.com Remove unused generic type from BottomSheet (flutter/flutter#137791)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 035740c1f90e to ec20731de6ff (2 revisions) (flutter/flutter#137872)
2023-11-03 dacoharkes@google.com Pin dart-lang/native dependencies (flutter/flutter#137601)
2023-11-03 chris@bracken.jp Send caret rect to embedder on selection update (flutter/flutter#137863)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 677040f10f65 to 035740c1f90e (4 revisions) (flutter/flutter#137871)
2023-11-03 cbobbe@zulip.com Tooltip docs: Recommend setting preferBelow to false in theme (flutter/flutter#135879)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from f363a6e5e093 to 677040f10f65 (2 revisions) (flutter/flutter#137861)
2023-11-03 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Android] Support Android 34" (flutter/flutter#137865)
2023-11-03 sokolovskyi.konstantin@gmail.com InkFeature should dispatch creation and disposal events. (flutter/flutter#137793)
2023-11-03 sokolovskyi.konstantin@gmail.com AppLifecycleListener should dispatch creation and disposal events. (flutter/flutter#137840)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d5ccb5b1b706 to f363a6e5e093 (2 revisions) (flutter/flutter#137858)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 72262a238090 to d5ccb5b1b706 (3 revisions) (flutter/flutter#137857)
2023-11-03 hans.muller@gmail.com Updated the nested navigation NavigationBar example (flutter/flutter#137788)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0415a4f5e2a2 to 72262a238090 (2 revisions) (flutter/flutter#137853)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 8531c5935356 to 0415a4f5e2a2 (1 revision) (flutter/flutter#137847)
2023-11-03 jonahwilliams@google.com Roll flutter gallery version forward. (flutter/flutter#137846)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 43653c5a3ec8 to 8531c5935356 (1 revision) (flutter/flutter#137845)
2023-11-03 engine-flutter-autoroll@skia.org Roll Packages from 33c2b4e to cccf5d2 (6 revisions) (flutter/flutter#137841)
2023-11-03 matej.knopp@gmail.com [web] dispatch corresponding keyup events in text editing integrations (flutter/flutter#136874)
2023-11-03 41873024+droidbg@users.noreply.github.com [leak-tracking] Add more leak tracking in test/painting flutter#3 (flutter/flutter#136170)
2023-11-03 polinach@google.com Upgrade leak_tracker and remove some deps in allow list. (flutter/flutter#137806)
2023-11-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from fc7c3f70c076 to 43653c5a3ec8 (1 revision) (flutter/flutter#137827)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
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 f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants