Skip to content

"flutter drive" CLI is confusing #5800

Closed as not planned
Closed as not planned

Description

@Hixie
$ flutter drive --profile
Test file not found: test_driver/main_test.dart

$ flutter drive --profile -t test_driver/main.dart
Target file "test_driver/main.dart" not found.

$ flutter drive --profile test_driver/scroll_perf.dart
Starting application: lib/main.dart

$ flutter drive --profile -t test_driver/scroll_perf.dart
Starting application: test_driver/scroll_perf.dart

$ flutter drive --profile -t test_driver/scroll_perf_test.dart
Test file not found: test_driver/scroll_perf_test_test.dart

I AM THE CONFOOSE.

Activity

  1. added this to the milestone on Sep 9, 2016
  2. Hixie commented on Sep 9, 2016

    @Hixie
    ContributorAuthor

    (flutter drive --help doesn't illuminate, either)

  3. yjbanov commented on Sep 13, 2016

    @yjbanov
    Contributor

    Would it help if the driver printed the target file and the test file it is about to use for the test? Using your examples the output would look like this:

    $ flutter drive --profile
    Will use:
      target: lib/main.dart
      test  : test_driver/main_test.dart
    
    Test file not found: test_driver/main_test.dart
    
    $ flutter drive --profile -t test_driver/main.dart
    Will use:
      target: test_driver/main.dart
      test  : test_driver/main_test.dart
    
    Target file "test_driver/main.dart" not found.
    
    $ flutter drive --profile -t test_driver/scroll_perf.dart
    Will use:
      target: test_driver/scroll_perf.dart
      test  : test_driver/scroll_perf_test.dart
    
    Starting application: test_driver/scroll_perf.dart
    
    $ flutter drive --profile -t test_driver/scroll_perf_test.dart
    Will use:
      target: test_driver/scroll_perf_test.dart
      test  : test_driver/scroll_perf_test_test.dart
    
    Test file not found: test_driver/scroll_perf_test_test.dart
    

    The following should be made illegal:

    $ flutter drive --profile test_driver/scroll_perf.dart
    

    flutter driver --help should be expanded to explain what is "target" and what is "test".

  4. Hixie commented on Sep 15, 2016

    @Hixie
    ContributorAuthor

    I expected the syntax to be flutter drive <target> -t <test> or flutter drive <test> -t <target> or some such, with maybe the test defaulting to something based on the target. (Note that we've dropped -t from most other commands, but then they only care about one file usually.)

  5. Hixie commented on Oct 10, 2016

    @Hixie
    ContributorAuthor

    One thing that we should improve when we look at this is the test should know what the target was, that way when it gives error messages (e.g. the one you get after a timeout) it could use the actual correct filename. (That error messages said it's "often lib/main.dart", but that seems false since the target is chosen based on what test is run.)

  6. modified the milestones: , on Jan 17, 2018
  7. Hixie commented on Jan 17, 2018

    @Hixie
    ContributorAuthor

    @yjbanov If we're going to change this we should probably do it relatively soon because otherwise people might end up depending on the syntax here.

  8. yjbanov commented on Mar 20, 2018

    @yjbanov
    Contributor

    @Hixie, after you introduced --driver option this might be less of an issue. One no longer needs to rely on the convention how flutter drive finds files and specify them explicitly (the messages are only confusing because you need to be aware of the default behavior).

    In fact, I'm tempted to remove the convention entirely. flutter driver is not a frequently-used command (0.16% according to analytics). So the convention does not seem to add much value.

    As for syntax dependency, the convention is to use the --machine option for commands that support it. We might want to discourage machine consumption of our tools' human-readable output.

  9. added a commit that references this issue on Jul 19, 2018
  10. added a commit that references this issue on Jul 19, 2018
  11. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  12. removed this from the milestone on Jun 2, 2020
  13. removed this from the milestone on Jun 2, 2020
  14. removed this from the milestone on Aug 17, 2020
  15. matanlurey commented on Jun 27, 2025

    @matanlurey
    Contributor

    Tools team is closing this as a not-planned improvement (we made some minor improvements other years).

  16. github-actions commented on Jul 11, 2025

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

  17. locked as resolved and limited conversation to collaborators on Jul 11, 2025
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 listteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions