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

[ci][web] Run tests in canvaskit mode. #6879

Merged
merged 10 commits into from
Jul 11, 2024

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jun 6, 2024

Configures the flutter/packages CI to run web tests using the canvaskit renderer, which is the new default for web apps.

It also does some minor changes:

  • Skips tests on the web for package:palette_generator (cleanup issue created below)
    • Makes the palette_generator example run on the web. This was used to manually verify that the package still works as expected with canvaskit.
  • Tweaks the README of the pointer_interceptor example apps, so they match what's happening in there.

Issues

Pre-launch Checklist

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

Co-authored-by: David Iglesias [email protected]

@ditman
Copy link
Member

ditman commented Jun 11, 2024

(Linux_android android_platform_tests_shard_6 master is a known flake, I've restarted it)

@ditman
Copy link
Member

ditman commented Jun 11, 2024

dit@dit:/work/flutter/packages/packages/palette_generator$ flutter test --color --platform=chrome --web-renderer=canvaskit -v
...
[    1 ms] Launching Chromium (url = http://localhost:40285/static/index.html?managerUrl=ws://localhost:40285/0&debug=false, headless = true,
skipCheck = false, debugPort = null)
[    1 ms] Will use Chromium executable at google-chrome
[   87 ms] Using Google Chrome 126.0.6478.55 

[  210 ms] [CHROME]: 
[        ] [CHROME]: DevTools listening on ws://127.0.0.1:34627/devtools/browser/2bef8322-20d8-4960-8577-5f04f53770d2
[  187 ms] Running test suite test/palette_generator_test.dart.
00:04  15: PaletteTarget == does not crash on invalid comparisons                                                                                              [ 3491 ms] Shutting down Chromium.
00:04  15: All tests passed!
...

I have a suspicion that the version of Chrome we're using in CI for flutter test may be a little bit too old, I haven't been able to reproduce the failure locally.

CI is using:

Chromium 114.0.5735.0

@ditman
Copy link
Member

ditman commented Jun 11, 2024

Running with Chrome For Testing 114...

dit@dit:/work/flutter/packages/packages/palette_generator$ CHROME_EXECUTABLE=/work/flutter/packages/packages/palette_generator/chrome-linux64/chrome flutter test --platform chrome --web-renderer canvaskit -v
...
[    1 ms] Launching Chromium (url = http://localhost:45565/static/index.html?managerUrl=ws://localhost:45565/0&debug=false, headless = true,
skipCheck = false, debugPort = null)
[    1 ms] Will use Chromium executable at /work/flutter/packages/packages/palette_generator/chrome-linux64/chrome
[   58 ms] Using Google Chrome for Testing 114.0.5696.0 
[  122 ms] [CHROME]: 
[    1 ms] [CHROME]: DevTools listening on ws://127.0.0.1:39723/devtools/browser/80547466-8479-4fe4-b64d-2bf927a1aed7
[  204 ms] Running test suite test/palette_generator_test.dart.
00:03  15: PaletteTarget == does not crash on invalid comparisons                                                                                              [ 3480 ms] Shutting down Chromium.
00:03  15: All tests passed!                                                                                                                                   

Running with an older version of Chromium also passes:

dit@dit:/work/flutter/packages/packages/palette_generator$ CHROME_EXECUTABLE=/work/flutter/packages/packages/palette_generator/chromium-linux64/chrome flutter test --platform chrome --web-renderer canvaskit -v
...
[    1 ms] Launching Chromium (url = http://localhost:44353/static/index.html?managerUrl=ws://localhost:44353/0&debug=false, headless = true,
skipCheck = false, debugPort = null)
[    1 ms] Will use Chromium executable at /work/flutter/packages/packages/palette_generator/chromium-linux64/chrome
[   51 ms] Using Chromium 113.0.5672.127 

[  124 ms] [CHROME]: 
[    1 ms] [CHROME]: DevTools listening on ws://127.0.0.1:43267/devtools/browser/9c8eafc4-90d4-44fd-925f-2bf667e20cf2
[  220 ms] Running test suite test/palette_generator_test.dart.
00:04  15: PaletteTarget == does not crash on invalid comparisons                                                                                              [ 4123 ms] Shutting down Chromium.
00:04  15: All tests passed!                                                                                                                                   

@ditman
Copy link
Member

ditman commented Jun 12, 2024

Tried running the example app in the browser with --web-renderer canvaskit, and it seems to be working just fine. Also tried with the --disable-gpu chrome command-line flag, but no change either.

Here's what the example app looks like on the web (right) vs an android emulator (left):

Screenshot 2024-06-11 at 6 37 34 PM

@mdebbar
Copy link
Contributor Author

mdebbar commented Jun 12, 2024

I, too, haven't been able to reproduce the failure locally.

@ditman
Copy link
Member

ditman commented Jun 25, 2024

Rebased (and force-pushed) to get some fresh results

@ditman
Copy link
Member

ditman commented Jul 9, 2024

Working to land this one this week.

@ditman
Copy link
Member

ditman commented Jul 9, 2024

The repo checks are flagging that there's a missing CHANGELOG entry in pointer_interceptor, however we're only changing the README of the example app, which doesn't get published anywhere. I'm skipping that check.

The following packages had errors:
  packages/pointer_interceptor/pointer_interceptor:
    Missing CHANGELOG change

@ditman ditman added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Jul 9, 2024
@ditman
Copy link
Member

ditman commented Jul 9, 2024

Created issue to track re-enabling tests for palette_generator on the web:

@ditman ditman requested a review from stuartmorgan July 10, 2024 00:10
@ditman ditman marked this pull request as ready for review July 10, 2024 00:10
@ditman ditman changed the title [web][tests] Run tests in canvaskit mode [ci][web] Run tests in canvaskit mode. Jul 10, 2024
@ditman
Copy link
Member

ditman commented Jul 10, 2024

PTAL @stuartmorgan!

Copy link
Contributor

@stuartmorgan stuartmorgan left a comment

Choose a reason for hiding this comment

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

LGTM with small suggestions.

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

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

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@ditman ditman added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 11, 2024
@auto-submit auto-submit bot merged commit da04812 into flutter:main Jul 11, 2024
74 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 12, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 12, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 12, 2024
flutter/packages@ea35fc6...3379e51

2024-07-12 [email protected] [pigeon] Fix C   enum naming (flutter/packages#7094)
2024-07-12 [email protected] [ci] Split build_all_packages by JDK version. (flutter/packages#7106)
2024-07-12 41930132 [email protected] [ios]Fix compile error when conforming UIApplication to Launcher due to MainActor annotation (flutter/packages#7100)
2024-07-11 47866232 [email protected] [go_router] Makes GoRouterState lookup more robust. (flutter/packages#6920)
2024-07-11 [email protected] [ci][web] Run tests in canvaskit mode. (flutter/packages#6879)
2024-07-10 49699333 dependabot[bot]@users.noreply.github.com [image_picker]: Bump androidx.core:core from 1.10.1 to 1.13.1 in /packages/image_picker/image_picker_android/android (flutter/packages#6648)

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 p: palette_generator p: pointer_interceptor platform-web
Projects
None yet
4 participants