Skip to content

Conversation

@matanlurey
Copy link
Contributor

@matanlurey matanlurey commented Jan 13, 2025

The goal here is to have a great standalone android_engine_test suite that replaces scenario_app/android.

No test is functionally changed in this PR, but overview of changes:

  • Finished renaming the suite android_engine_tests instead of flutter_driver_android
  • Added instructions and an environment variable for local generation of golden-files (UPDATE_GOLDENS=1)
  • Added explanations of the individual tests, where they live, and how to run them locally
  • Added a hybrid-composition (HC, not TLHC, which is already tested) test
  • Renamed "other_smiley" to "surface_texture_smiley" (and renamed the original to "surface_producer_smiley")
  • Removed unnecessary ".android" suffix (we will not run this on anything but Android)
  • Added a tool/deflake.dart to run a test suite 10x (or custom) times locally to try and determine flakiness

After this PR, I'll add flags to let you control variants and name the screenshots accordingly, i.e.:

  • API v34 or v35
  • OpenGLES or Vulkan (will require an AndroidManifest.xml edit during the test instrumentation)

@matanlurey matanlurey marked this pull request as ready for review January 13, 2025 22:45
@matanlurey matanlurey changed the title WIP: Refactor android_engine_test. Refactor android_engine_test, make it easier to debug/deflake locally. Jan 13, 2025
@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 #161534 at sha f239cb8

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Jan 14, 2025
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

$ flutter drive lib/platform_view_tap_color_change_main_test.dart
```

Files of significance:
Copy link
Contributor

Choose a reason for hiding this comment

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

Non blocking, I am not sure files of significance adds much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

await expectLater(
nativeDriver.screenshot(),
matchesGoldenFile('external_texture_smiley_face.android.png'),
matchesGoldenFile('external_texture_surface_producer_smiley_face.png'),
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own education what controls the name of this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The literal string. That is, we could call this poop.png and it would work, so it's just a convention.

test('should screenshot and match a blue -> orange gradient', () async {
await expectLater(
nativeDriver.screenshot(),
matchesGoldenFile('$goldenPrefix.blue_orange_gradient_portrait.png'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do these tests need a golden prefix but the blue rectangle ones do not?

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 file has multiple goldens, the other one does not.

nativeDriver.screenshot(),
matchesGoldenFile('$goldenPrefix.blue_orange_gradient_portrait.png'),
);
}, timeout: Timeout.none);
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own education why do these tests get no timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a requirement of our infra (I don't agree with it):

final int timeoutNoneCount = 'timeout: Timeout.none'.allMatches(contents).length;

}
}

final ArgParser _argParser =
Copy link
Contributor

Choose a reason for hiding this comment

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

nonblocking nit: I would prefer this to be at the top of main. My inital read I didn't realize there were flags that could be passed and thought your documentation was future looking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds reasonable. Done!

@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 #161534 at sha 0fd61e3

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 14, 2025
@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 #161534 at sha d462077

@auto-submit auto-submit bot added this pull request to the merge queue Jan 15, 2025
Merged via the queue into flutter:master with commit e517ae3 Jan 15, 2025
177 of 178 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 16, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 16, 2025
flutter/flutter@40c2b86...5517cc9

2025-01-15 [email protected] feat: Change default value of keyboardDismissBehavior (flutter/flutter#158580)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161680)
2025-01-15 [email protected] Revert "Autocomplete Options Width" (flutter/flutter#161666)
2025-01-15 [email protected] Update two_dimensional_scrollables triage routing (flutter/flutter#161667)
2025-01-15 [email protected] [DisplayList] Migrate from SkRSXform to Impeller RSTransform (flutter/flutter#161652)
2025-01-15 [email protected] Roll Packages from d1fd623 to f73cb00 (2 revisions) (flutter/flutter#161672)
2025-01-15 [email protected] Fix DropdownMenu isCollapsed decoration does not Reduce height (flutter/flutter#161427)
2025-01-15 [email protected] Manual roll of Skia to e7b8d078851f (flutter/flutter#161609)
2025-01-15 [email protected] Fix `TabBar` glitchy elastic `Tab`  animation (flutter/flutter#161514)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161643)
2025-01-15 [email protected] Exclude the top-level `engine` directory from `generate_gradle_lockfiles`. (flutter/flutter#161635)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161632)
2025-01-15 [email protected] Refactor `android_engine_test`, make it easier to debug/deflake locally. (flutter/flutter#161534)
2025-01-15 [email protected] [Impeller] null check device buffer in image encoding. (flutter/flutter#161194)
2025-01-15 [email protected] Feature/twitter keyboard (flutter/flutter#161025)
2025-01-15 [email protected] Fixed XiaoMi statusBar Bug (flutter/flutter#161271)
2025-01-15 [email protected] Clean up engine's analysis_options.yaml (flutter/flutter#161554)
2025-01-14 [email protected] Remove `gradle_deprecated_settings` test app, and remove reference from lockfile exclusion yaml (flutter/flutter#161622)
2025-01-14 [email protected] [deps] remove no-longer-used repo deps (flutter/flutter#161605)
2025-01-14 [email protected] [DisplayList] remove obsolete use of Skia goemetry objects in DL utils (flutter/flutter#161553)
2025-01-14 [email protected] [Engine] Support asymmetrical rounded superellipses (flutter/flutter#161409)
2025-01-14 [email protected] [SwiftPM] Make 'flutter build ios-framework' generate an empty Package.swift (flutter/flutter#161464)
2025-01-14 [email protected] [canvaskit] Fix GIF decode failure (flutter/flutter#161536)
2025-01-14 [email protected] [Impeller] fixes for AHB swapchains. (flutter/flutter#161562)
2025-01-14 [email protected] Last Engine<>Framework lint sync (flutter/flutter#161560)
2025-01-14 [email protected] Check that localization files of stocks app are up-to-date (flutter/flutter#161608)
2025-01-14 [email protected] [Android] Actually remove dev dependencies from release builds (flutter/flutter#161343)
2025-01-14 [email protected] Update package revisions to latest (flutter/flutter#161525)

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
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
flutter/flutter@40c2b86...5517cc9

2025-01-15 [email protected] feat: Change default value of keyboardDismissBehavior (flutter/flutter#158580)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161680)
2025-01-15 [email protected] Revert "Autocomplete Options Width" (flutter/flutter#161666)
2025-01-15 [email protected] Update two_dimensional_scrollables triage routing (flutter/flutter#161667)
2025-01-15 [email protected] [DisplayList] Migrate from SkRSXform to Impeller RSTransform (flutter/flutter#161652)
2025-01-15 [email protected] Roll Packages from d1fd623 to f73cb00 (2 revisions) (flutter/flutter#161672)
2025-01-15 [email protected] Fix DropdownMenu isCollapsed decoration does not Reduce height (flutter/flutter#161427)
2025-01-15 [email protected] Manual roll of Skia to e7b8d078851f (flutter/flutter#161609)
2025-01-15 [email protected] Fix `TabBar` glitchy elastic `Tab`  animation (flutter/flutter#161514)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161643)
2025-01-15 [email protected] Exclude the top-level `engine` directory from `generate_gradle_lockfiles`. (flutter/flutter#161635)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161632)
2025-01-15 [email protected] Refactor `android_engine_test`, make it easier to debug/deflake locally. (flutter/flutter#161534)
2025-01-15 [email protected] [Impeller] null check device buffer in image encoding. (flutter/flutter#161194)
2025-01-15 [email protected] Feature/twitter keyboard (flutter/flutter#161025)
2025-01-15 [email protected] Fixed XiaoMi statusBar Bug (flutter/flutter#161271)
2025-01-15 [email protected] Clean up engine's analysis_options.yaml (flutter/flutter#161554)
2025-01-14 [email protected] Remove `gradle_deprecated_settings` test app, and remove reference from lockfile exclusion yaml (flutter/flutter#161622)
2025-01-14 [email protected] [deps] remove no-longer-used repo deps (flutter/flutter#161605)
2025-01-14 [email protected] [DisplayList] remove obsolete use of Skia goemetry objects in DL utils (flutter/flutter#161553)
2025-01-14 [email protected] [Engine] Support asymmetrical rounded superellipses (flutter/flutter#161409)
2025-01-14 [email protected] [SwiftPM] Make 'flutter build ios-framework' generate an empty Package.swift (flutter/flutter#161464)
2025-01-14 [email protected] [canvaskit] Fix GIF decode failure (flutter/flutter#161536)
2025-01-14 [email protected] [Impeller] fixes for AHB swapchains. (flutter/flutter#161562)
2025-01-14 [email protected] Last Engine<>Framework lint sync (flutter/flutter#161560)
2025-01-14 [email protected] Check that localization files of stocks app are up-to-date (flutter/flutter#161608)
2025-01-14 [email protected] [Android] Actually remove dev dependencies from release builds (flutter/flutter#161343)
2025-01-14 [email protected] Update package revisions to latest (flutter/flutter#161525)

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
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
flutter/flutter@40c2b86...5517cc9

2025-01-15 [email protected] feat: Change default value of keyboardDismissBehavior (flutter/flutter#158580)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161680)
2025-01-15 [email protected] Revert "Autocomplete Options Width" (flutter/flutter#161666)
2025-01-15 [email protected] Update two_dimensional_scrollables triage routing (flutter/flutter#161667)
2025-01-15 [email protected] [DisplayList] Migrate from SkRSXform to Impeller RSTransform (flutter/flutter#161652)
2025-01-15 [email protected] Roll Packages from d1fd623 to f73cb00 (2 revisions) (flutter/flutter#161672)
2025-01-15 [email protected] Fix DropdownMenu isCollapsed decoration does not Reduce height (flutter/flutter#161427)
2025-01-15 [email protected] Manual roll of Skia to e7b8d078851f (flutter/flutter#161609)
2025-01-15 [email protected] Fix `TabBar` glitchy elastic `Tab`  animation (flutter/flutter#161514)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161643)
2025-01-15 [email protected] Exclude the top-level `engine` directory from `generate_gradle_lockfiles`. (flutter/flutter#161635)
2025-01-15 [email protected] Roll pub packages (flutter/flutter#161632)
2025-01-15 [email protected] Refactor `android_engine_test`, make it easier to debug/deflake locally. (flutter/flutter#161534)
2025-01-15 [email protected] [Impeller] null check device buffer in image encoding. (flutter/flutter#161194)
2025-01-15 [email protected] Feature/twitter keyboard (flutter/flutter#161025)
2025-01-15 [email protected] Fixed XiaoMi statusBar Bug (flutter/flutter#161271)
2025-01-15 [email protected] Clean up engine's analysis_options.yaml (flutter/flutter#161554)
2025-01-14 [email protected] Remove `gradle_deprecated_settings` test app, and remove reference from lockfile exclusion yaml (flutter/flutter#161622)
2025-01-14 [email protected] [deps] remove no-longer-used repo deps (flutter/flutter#161605)
2025-01-14 [email protected] [DisplayList] remove obsolete use of Skia goemetry objects in DL utils (flutter/flutter#161553)
2025-01-14 [email protected] [Engine] Support asymmetrical rounded superellipses (flutter/flutter#161409)
2025-01-14 [email protected] [SwiftPM] Make 'flutter build ios-framework' generate an empty Package.swift (flutter/flutter#161464)
2025-01-14 [email protected] [canvaskit] Fix GIF decode failure (flutter/flutter#161536)
2025-01-14 [email protected] [Impeller] fixes for AHB swapchains. (flutter/flutter#161562)
2025-01-14 [email protected] Last Engine<>Framework lint sync (flutter/flutter#161560)
2025-01-14 [email protected] Check that localization files of stocks app are up-to-date (flutter/flutter#161608)
2025-01-14 [email protected] [Android] Actually remove dev dependencies from release builds (flutter/flutter#161343)
2025-01-14 [email protected] Update package revisions to latest (flutter/flutter#161525)

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
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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

will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants