Repository navigation
Description
Early in the web support phase, I added support for directly testing in a chrome browser for a simulated test environment. This may have proved useful in helping the web bootstrap, but long-term it does not present a very compelling test environment. Since it doesn't actually perform rendering/painting it only really tests the interface between the engine and framework. Compared to actual integration tests on real browsers, it is of limited use for ensuring correctness. In addition, these tests are highly flaky on CI due to in part to the orchestration complexity.
Unfortunately it also adds a lot of dependencies to the flutter tool. This was acceptable since we needed them anyway for flutter run. When we move to the frontend_server, many of these dependencies are no longer needed though. Notably, the build_runner dependency is one of two transitive mirrors dependencies that prevents an AOT built tool
I propose that in the short-term, we remove support for flutter test --platform=chrome from the tool into a special purpose command in dev/bots/. This would still be usable for the framework CI, but would no longer be accessible for the tool.
EDIT:
@yjbanov @Piinks, are there any implications for web goldens?
Activity
ditman commentedon Feb 11, 2020
/cc @collinjackson IIRC this was one of the strategies used to run integration tests in Firebase plugins.
(Edit: now that I think of this, integ tests may be being run with flutter run some app inside test/blah.dart and not with flutter test)
collinjackson commentedon Feb 11, 2020
SGTM
@ditman yes, I think this removal doesn't interfere with the short-term roadmap for web plugin integration testing since we are using
flutter runorflutter driveto launch those tests. See #49833In the long term I'd like to see something like
flutter test -d chrome... debuggable integration testing on real devices/browsers. Here's a related issue for that: #29401jonahwilliams commentedon Feb 11, 2020
Thanks @collinjackson and @ditman !
nturgut commentedon Feb 11, 2020
All fine with new web engine integration testing. Thanks for notifying!
chingjun commentedon Feb 12, 2020
The
package:flutter_toolspart of it is not being used internally, but the support inpackage:flutter_testis. I assume that the changes you proposed does not affectpackage:flutter_test. If so then removing that shouldn't affect our internal tests.jonahwilliams commentedon Feb 12, 2020
This would preserve all of the flutter_test changes
Piinks commentedon Feb 12, 2020
As I understand it, I don't think this would impact golden file testing. IIRC, web goldens have been pretty flaky and most of them are still disabled, @chingjun might be able to speak more on that. If we need to make a change as a result of this, it might be for the better. :)
ditman commentedon Feb 12, 2020
QQ I just found myself doing
fluter test --platform chrometo run these tests;What kind of changes will we have to do to those tests to run them after this gets merged?
yjbanov commentedon Feb 12, 2020
SGTM. @ditman since these tests are run only by Flutter contributors we can add this functionality to
felt(or a new tool so one doesn't need to have a checkout of the engine repo).ditman commentedon Feb 12, 2020
OK, I'll keep an eye to the required changes to migrate the tests ASAP (or add instructions). Thanks!
collinjackson commentedon Feb 12, 2020
After looking more closely at this, https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_firestore/cloud_firestore_web/test/write_batch_web_test.dart#L5 is a plugins unit test and it would be good to have a way to keep that working for non-Flutter contributors.
yjbanov commentedon Feb 12, 2020
@collinjackson just pointed out that the test you linked to is not a Flutter framework test. So I was wrong. Flutter contributors are not the only ones using it. So we need to be more careful about this change.
1 remaining item
jonahwilliams commentedon Feb 13, 2020
There is another option here, which would be to rewrite the command to use the frontend_server instead of build_runner, which would alleviate the flutter_tools dependency issue. it doesn't change the support issue, nor the tools' current priorities.
I could advise on the design and code review, if someone else wanted to take up the implementation work.
yjbanov commentedon Feb 13, 2020
Optimistically putting it in the near-term milestone, but feel free to adjust.
github-actions commentedon Aug 9, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.