-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
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 --debugand 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.apkThis 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.