Skip to content

flutter test is missing the --use-application-binary argument, which flutter drive has #114541

@bartekpacia

Description

@bartekpacia

Description

flutter drive has the --use-application-binary argument. Run flutter drive --help to see its description:

Specify a pre-built application binary to use when running. For Android applications, this must be the path to an APK. For iOS applications, the path to an IPA. Other device types do not yet support prebuilt application binaries.

This is a very useful option when debugging the integration tests for flakiness. I can do

$ flutter build apk --debug

and then I can use the prebuilt APK many times in flutter drive:

$ flutter drive \
  --driver test_driver/integration_test.dart \
  --use-application-binary build/app/outputs/flutter-apk/app-debug.apk

This skips the build and goes straight to driving the app, greatly improving test execution.

It's annoying that flutter test doesn't have this flag.

Expected results:

I can pass the path to a prebuilt .apk or .app to flutter test with the --use-application-binary argument, just like with flutter drive.

It would only make sense for it to work with flutter test integration_test, not with "bare" flutter test.

Actual results:

$ flutter test integration_test --use-application-binary build/app/outputs/flutter-apk/app-debug.apk
Could not find an option named "use-application-binary".


Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
flutter --version
$ flutter --version                                                                                                                                                                                                                                                                                                 
Flutter 3.3.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e99c9c7cd9 (19 hours ago) • 2022-11-01 16:59:00 -0700
Engine • revision 857bd6b74c
Tools • Dart 2.18.4 • DevTools 2.15.0

PS In the bigger picture, I think that running both unit&widget tests and integration tests with the single flutter test command is a mistake because there're too many differences between these 2 types of tests. See this comment, which I agree with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: tests"flutter test", flutter_test, or one of our testsc: new featureNothing broken; request for a new capabilityteam-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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy