Skip to content

Remove chrome platform from flutter test #50594

Closed

Description

@jonahwilliams

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.

@nturgut @yjbanov @zanderso

EDIT:

@yjbanov @Piinks, are there any implications for web goldens?

@mehmetf @chingjun, is this code used in google3 at all?

Activity

  1. added
    c: contributor-productivity
    tool
    platform-web
    on Feb 11, 2020
  2. ditman commented on Feb 11, 2020

    @ditman
    Member

    /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)

  3. collinjackson commented on Feb 11, 2020

    @collinjackson
    Contributor

    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 run or flutter drive to launch those tests. See #49833

    In 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: #29401

  4. jonahwilliams commented on Feb 11, 2020

    @jonahwilliams
    ContributorAuthor

    Thanks @collinjackson and @ditman !

  5. nturgut commented on Feb 11, 2020

    @nturgut
    Contributor

    All fine with new web engine integration testing. Thanks for notifying!

  6. chingjun commented on Feb 12, 2020

    @chingjun
    Contributor

    The package:flutter_tools part of it is not being used internally, but the support in package:flutter_test is. I assume that the changes you proposed does not affect package:flutter_test. If so then removing that shouldn't affect our internal tests.

  7. jonahwilliams commented on Feb 12, 2020

    @jonahwilliams
    ContributorAuthor

    This would preserve all of the flutter_test changes

  8. Piinks commented on Feb 12, 2020

    @Piinks
    Contributor

    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. :)

  9. ditman commented on Feb 12, 2020

    @ditman
    Member

    QQ I just found myself doing fluter test --platform chrome to run these tests;

    What kind of changes will we have to do to those tests to run them after this gets merged?

  10. yjbanov commented on Feb 12, 2020

    @yjbanov
    Contributor

    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).

  11. ditman commented on Feb 12, 2020

    @ditman
    Member

    OK, I'll keep an eye to the required changes to migrate the tests ASAP (or add instructions). Thanks!

  12. collinjackson commented on Feb 12, 2020

    @collinjackson
    Contributor

    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.

  13. yjbanov commented on Feb 12, 2020

    @yjbanov
    Contributor

    @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.

  14. 1 remaining item

  15. jonahwilliams commented on Feb 13, 2020

    @jonahwilliams
    ContributorAuthor

    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.

  16. added this to the milestone on Feb 13, 2020
  17. yjbanov commented on Feb 13, 2020

    @yjbanov
    Contributor

    Optimistically putting it in the near-term milestone, but feel free to adjust.

  18. added
    P1
    on May 29, 2020
  19. modified the milestone: on Jun 1, 2020
  20. added
    P2
    and removed
    P1
    on Jun 16, 2020
  21. modified the milestone: on Jul 7, 2020
  22. removed this from the milestone on Jul 22, 2020
  23. removed this from the milestone on Aug 17, 2020
  24. github-actions commented on Aug 9, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  25. locked as resolved and limited conversation to collaborators on Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2c: contributor-productivityplatform-webtool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions