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

[webview_flutter_web] Migrate integration tests to package:web. #7115

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ditman
Copy link
Member

@ditman ditman commented Jul 13, 2024

This PR:

  • Fixes a DOM timing issue that was preventing the Legacy Widget from building.
  • Makes the integration_tests for the package less flaky, now that they seem to be timing out unexpectedly in CI.

Issues

Pre-launch Checklist

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

@ditman
Copy link
Member Author

ditman commented Jul 13, 2024

Now the non-legacy test should actually do something in CI. The legacy one is only left as a manual check. No coverage is lost, since neither of the tests were actually verifying anything earlier (the bug that is being fixed here should have been caught by a functional legacy test!)

This should also ease the Linux_web web_platform_tests_shard_3 flakes. In my machine this PR seems to not flake, unlike what's currently in the repo!

@ditman
Copy link
Member Author

ditman commented Jul 13, 2024

@ditman
Copy link
Member Author

ditman commented Jul 13, 2024

$ flutter --version
Flutter 3.22.2 • channel stable • git@github.com:flutter/flutter.git
Framework • revision 761747bfc5 (5 weeks ago) • 2024-06-05 22:15:13 +0200
Engine • revision edd8546116
Tools • Dart 3.4.3 • DevTools 2.34.3
$ flutter clean; run_integration_test.sh | ts -s
00:00:03 
00:00:03 ============================================================
00:00:03 || Running for packages/webview_flutter/webview_flutter_web
00:00:03 ============================================================
00:00:03 
00:00:03 Starting chromedriver on port 4444
00:00:03 Running command: "flutter drive -d web-server --web-port=7357 --browser-name=chrome --web-renderer=canvaskit --driver test_driver/integration_test.dart --target integration_test/webview_flutter_test.dart" in /work/flutter/packages/packages/webview_flutter/webview_flutter_web/example
00:00:03 Resolving dependencies...
00:00:04 Downloading packages...
00:00:04   collection 1.18.0 (1.19.0 available)
00:00:04   leak_tracker 10.0.4 (10.0.5 available)
00:00:04   leak_tracker_flutter_testing 3.0.3 (3.0.5 available)
00:00:04   material_color_utilities 0.8.0 (0.12.0 available)
00:00:04   meta 1.12.0 (1.15.0 available)
00:00:04   platform 3.1.4 (3.1.5 available)
00:00:04   string_scanner 1.2.0 (1.3.0 available)
00:00:04   test_api 0.7.0 (0.7.3 available)
00:00:04   vm_service 14.2.1 (14.2.4 available)
00:00:04 Got dependencies!
00:00:04 9 packages have newer versions incompatible with dependency constraints.
00:00:04 Try `flutter pub outdated` for more information.
00:00:04 Launching integration_test/webview_flutter_test.dart on Web Server in debug mode...
00:00:31 Waiting for connection from debug service on Web Server...         26.3s
00:00:31 integration_test/webview_flutter_test.dart is being served at http://localhost:7357
00:00:31 The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
00:00:38 All tests passed.
00:00:38 Application finished.
00:00:39 Stopping chromedriver
00:00:39 
00:00:39 
00:00:39 ------------------------------------------------------------
00:00:39 Run overview:
00:00:39   packages/webview_flutter/webview_flutter_web - ran
00:00:39 
00:00:39 Ran for 1 package(s)
00:00:39 
00:00:39 
00:00:39 No issues found!

vs CI. 🤷

@ditman
Copy link
Member Author

ditman commented Jul 13, 2024

The problem seems to stem from some DDC modules not being ready/available when the app starts. It doesn't always reproduce, but it can be seen when the app fails to start with --no-headless flag set:

Screenshot 2024-07-12 at 8 33 49 PM

(I've seen it also fail with a very similar trace, but complaining about IntegrationTestWidgetsFlutterBinding not being defined... Smells like a race condition! Are we attempting to start the app before the compilation is ready??)

I wonder if testing in --profile mode would yield better results (in general)

@ditman
Copy link
Member Author

ditman commented Jul 13, 2024

I wonder if testing in --profile mode would yield better results (in general)

It probably does, but we can't use that mode, because asserts don't work in --profile, and we have some tests that check that assertions are thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant