Skip to content

Make E2E use a custom test reporter so that invoking test() will work. #50816

Description

@collinjackson

Invoking test() won't result in failures being reported.

We could address this with either

  1. Improving documentation
  2. Do something clever with with imports (Dart provides mechanisms for hiding, showing, and aliasing of symbols) to get an app-facing test method that wraps testWidgets without causing compile errors.
  3. Hook into package:test instead of package:flutter_test at a different layer.

Activity

  1. dnfield commented on Jul 24, 2020

    @dnfield
    Contributor

    We can fix this by calling registerReporter from package:test_core in the e2e initialization logic. This way we can avoid the need to override runTest, and we can catch any package:test tests that are run.

  2. added
    P1High-priority issues at the top of the work list
    on Jul 24, 2020
  3. dnfield commented on Jul 24, 2020

    @dnfield
    Contributor
  4. CareF commented on Jul 24, 2020

    @CareF
    Contributor

    Does it make sense to have a testWidgets equivalence for E2E itself? testWidgets and WidgetTester looks more like optimized for unit test, but I think E2E is more like for integration and performance test.
    #61511 is probably also relevant.
    /cc @liyuqian

  5. natebosch commented on Jul 24, 2020

    @natebosch
    Contributor

    I think E2E is more like for integration and performance test.

    Performance testing is not a use case targeted by package:test and you should not trust that it won't subtly impact the way your code performs.

  6. dnfield commented on Jul 24, 2020

    @dnfield
    Contributor

    We should be able to measure the impact of performance tests based on the difference between package:e2e and package:flutter_driver (which doesn't use package:test on the device itself).

    More generally speaking though, e2e is for integration tests, which is broader than just performance tests. If we want to create a new way for e2e to do performance tests specifically that's fine, but we should support running test as well as testWidgets in an e2e test.

  7. CareF commented on Jul 24, 2020

    @CareF
    Contributor

    Performance testing is not a use case targeted by package:test and you should not trust that it won't subtly impact the way your code performs.

    So it makes more sense to have something like perfWidgets together with testWidgets for e2e for performance test purposes.
    My current measurement result is e2e + testWidgets is NOT lower than flutter_driver, if not faster. And in fact I do see cases where e2e is slightly faster than flutter_driver. https://github.com/CareF/measure_overhead for example.

  8. dnfield commented on Jul 24, 2020

    @dnfield
    Contributor

    I think we should probably just not worry too much about it until we have a compelling case to worry about it :) If we notice that performance based testing is not stable enough using testWidgets/test then we can address it.

  9. changed the title [-]More clearly document that testWidgets is required when using e2e[/-] [+]Make E2E use a custom test reporter so that invoking test() will work.[/+] on Jul 24, 2020
  10. 18 remaining items

  11. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Apr 26, 2022
  12. flutter-triage-bot commented on Nov 27, 2023

    @flutter-triage-bot

    This issue is marked P1 but has had no recent status updates.

    The P1 label indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug). Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub.

    Please consider where this bug really falls in our current priorities, and label it or assign it accordingly. This allows people to have a clearer picture of what work is actually planned. Thanks!

  13. added
    P2Important issues not at the top of the work list
    and removed
    P1High-priority issues at the top of the work list
    on Nov 29, 2023
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

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsd: api docsIssues with https://api.flutter.dev/f: integration_testThe flutter/packages/integration_test pluginframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions