Skip to content

Cupertino icons golden tests #7421

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

Merged
merged 14 commits into from
Aug 27, 2024

Conversation

LongCatIsLooong
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong commented Aug 15, 2024

This is for flutter/flutter#148075, we want to make sure the glyphs don't look different when the font generation script is migrated from python.
Also it will be nice to be able to inspect glyph changes whenever the ttf file gets updated. The flutter test command takes 6s to complete on my computer.

Unfortunately this test:

  • is sensitive to how flutter renders text on Linux, and how the Icon widget positions the glyph.
  • will require contributors to have access to a Linux box in order to generate new goldens.

The tests are disabled on the web since it needs the dart:io import.

The icons_list.dart file is automatically generated. Not sure if there's a way to incorporate the code gen step on CI?

Pre-launch Checklist

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

/// The full list of [IconData] constants defined in the [CupertinoIcons] class,
/// sorted by their code points in ascending order.
///
/// This list cannot be mutated.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This automatically generated. Is there a way to incorporate the code gen step on CI?

Copy link
Contributor

Choose a reason for hiding this comment

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

This automatically generated.

By what? There should be a prominent comment in this file explain that it is generated, and how to regenerate it.

Is there a way to incorporate the code gen step on CI?

Since this is included from another file, not currently; there is not currently a mechanism to generate files before analyze is run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I think about it, it's probably not a good idea to try to automate the codegen for now.

The codegen script generates the List of IconData from the CupertinoICons class which currently lives in flutter/flutter, so it updates with a delay after a new cupertino_icons version is available.

This list should be updated manually for now, after changing the ttf file. I'll add a comment to this file (or in a more visible place? since it's tied to the font).

@LongCatIsLooong LongCatIsLooong marked this pull request as ready for review August 15, 2024 21:29
@LongCatIsLooong LongCatIsLooong force-pushed the cupertino-icons-golden-tests branch 2 times, most recently from 3fbb667 to ff7cd7b Compare August 16, 2024 00:47
@LongCatIsLooong LongCatIsLooong force-pushed the cupertino-icons-golden-tests branch from ff7cd7b to 7a33212 Compare August 16, 2024 01:15
Copy link
Contributor

@victorsanni victorsanni left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

  • is sensitive to how flutter renders text on Linux, and how the Icon widget positions the glyph.

Any test in flutter/packages that is sensitive to framework rendering must be set up to run only on main (example), otherwise the first time there is a framework change that affects this test, it will become impossible to roll.

  • will require contributors to have access to a Linux box in order to generate new goldens.

FYI, in practice this means that the test will periodically be disabled by the gardener, with an issue filed against the package's CODEOWNER to re-enable it, because not all gardeners have access to a machine that can regenerate goldens.

/// The full list of [IconData] constants defined in the [CupertinoIcons] class,
/// sorted by their code points in ascending order.
///
/// This list cannot be mutated.
Copy link
Contributor

Choose a reason for hiding this comment

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

This automatically generated.

By what? There should be a prominent comment in this file explain that it is generated, and how to regenerate it.

Is there a way to incorporate the code gen step on CI?

Since this is included from another file, not currently; there is not currently a mechanism to generate files before analyze is run.

@LongCatIsLooong
Copy link
Contributor Author

LongCatIsLooong commented Aug 20, 2024

  • is sensitive to how flutter renders text on Linux, and how the Icon widget positions the glyph.

Any test in flutter/packages that is sensitive to framework rendering must be set up to run only on main (example), otherwise the first time there is a framework change that affects this test, it will become impossible to roll.

  • will require contributors to have access to a Linux box in order to generate new goldens.

FYI, in practice this means that the test will periodically be disabled by the gardener, with an issue filed against the package's CODEOWNER to re-enable it, because not all gardeners have access to a machine that can regenerate goldens.

Added myself to the codeowner list of the golden files.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

One question, but otherwise my CI concerns are addressed, thanks!

flutter:
sdk: flutter
flutter_test:
sdk: flutter
path: 1.9.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this pinned to an exact version? path is allowed as an unpinned dependency in the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the change after reading https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#dependencies

If you add a dev_dependency on an external package, pin it to a specific version if at all possible.

But it looks like that only applies to external packages. I'll change it back to any.

Copy link
Contributor

Choose a reason for hiding this comment

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

It shouldn't be any, it should be a standard ^ dependency.

@stuartmorgan-g stuartmorgan-g 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, 2024
@stuartmorgan-g
Copy link
Contributor

Version/CHANGELOG override: dev_dependency changes are exempt per policy.

@@ -14,7 +14,7 @@ dev_dependencies:
sdk: flutter
flutter_test:
sdk: flutter
path: 1.9.0
path: any
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g Aug 27, 2024

Choose a reason for hiding this comment

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

Please don't ever use any anywhere in a package; this is a recipe for OOB tree breakage. It literally means "I want to get intentionally breaking changes without warning".

@LongCatIsLooong LongCatIsLooong force-pushed the cupertino-icons-golden-tests branch from ff3a577 to fb4c4bb Compare August 27, 2024 15:32
@LongCatIsLooong LongCatIsLooong added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 27, 2024
@auto-submit auto-submit bot merged commit ef81058 into flutter:main Aug 27, 2024
76 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 29, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 29, 2024
flutter/packages@d862279...2a0f254

2024-08-28 [email protected] [interactive_media_ads] Adds internal wrapper for remaining methods of the Android native `AdsManager`  (flutter/packages#7437)
2024-08-28 [email protected] [shared_preferences] Fix typo in changelog (flutter/packages#7523)
2024-08-27 [email protected] Remove matan from codeowners (flutter/packages#7511)
2024-08-27 [email protected] [shared_preferences] Add test to enforce mutable lists (flutter/packages#7369)
2024-08-27 [email protected] [google_sign_in_ios] Fix "callee requires a non-null parameter" analyzer warning (flutter/packages#7513)
2024-08-27 [email protected] [in_app_purchase_storekit] Allows 'localizedDescription' to be nullable to handle occasional nulls in Storekit objects (flutter/packages#7515)
2024-08-27 [email protected] Cupertino icons golden tests (flutter/packages#7421)
2024-08-26 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 2.0.10 to 2.0.20 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#7500)
2024-08-26 [email protected] [video_player] Updates minimum supported SDK (flutter/packages#7498)
2024-08-26 [email protected] [url_launcher] Ignore new `unreachable_switch_default` warning. (flutter/packages#7487)
2024-08-26 [email protected] Revert "[video_player] Relands #6456: Uses SurfaceProducer, this time with setCallback for suspend/resume lifecycles" (flutter/packages#7497)
2024-08-24 [email protected] [video_player] Relands #6456: Uses `SurfaceProducer`, this time with `setCallback` for suspend/resume lifecycles. (flutter/packages#6989)
2024-08-23 [email protected] [google_maps_flutter_android] Convert `PlatformTileOverlay` to Pigeon (flutter/packages#7467)
2024-08-23 [email protected] [go_router] Fixes issue so that the parseRouteInformationWithContext â�¦ (flutter/packages#7337)

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 [email protected],[email protected] 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
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
flutter/packages@d862279...2a0f254

2024-08-28 [email protected] [interactive_media_ads] Adds internal wrapper for remaining methods of the Android native `AdsManager`  (flutter/packages#7437)
2024-08-28 [email protected] [shared_preferences] Fix typo in changelog (flutter/packages#7523)
2024-08-27 [email protected] Remove matan from codeowners (flutter/packages#7511)
2024-08-27 [email protected] [shared_preferences] Add test to enforce mutable lists (flutter/packages#7369)
2024-08-27 [email protected] [google_sign_in_ios] Fix "callee requires a non-null parameter" analyzer warning (flutter/packages#7513)
2024-08-27 [email protected] [in_app_purchase_storekit] Allows 'localizedDescription' to be nullable to handle occasional nulls in Storekit objects (flutter/packages#7515)
2024-08-27 [email protected] Cupertino icons golden tests (flutter/packages#7421)
2024-08-26 49699333+dependabot[bot]@users.noreply.github.com [pigeon]: Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 2.0.10 to 2.0.20 in /packages/pigeon/platform_tests/test_plugin/android (flutter/packages#7500)
2024-08-26 [email protected] [video_player] Updates minimum supported SDK (flutter/packages#7498)
2024-08-26 [email protected] [url_launcher] Ignore new `unreachable_switch_default` warning. (flutter/packages#7487)
2024-08-26 [email protected] Revert "[video_player] Relands flutter#6456: Uses SurfaceProducer, this time with setCallback for suspend/resume lifecycles" (flutter/packages#7497)
2024-08-24 [email protected] [video_player] Relands flutter#6456: Uses `SurfaceProducer`, this time with `setCallback` for suspend/resume lifecycles. (flutter/packages#6989)
2024-08-23 [email protected] [google_maps_flutter_android] Convert `PlatformTileOverlay` to Pigeon (flutter/packages#7467)
2024-08-23 [email protected] [go_router] Fixes issue so that the parseRouteInformationWithContext â�¦ (flutter/packages#7337)

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 [email protected],[email protected] 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
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 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_icons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants