You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integration test with integration_test package #3009
The args should show up in the args field there according to the code:
debugConfig.args = conf.flutterAdditionalArgs.concat(isTest ? conf.flutterTestAdditionalArgs : []).concat(debugConfig.args);
Which makes me think it's deciding this file is not a test
Ah, it's the folder
&& (isInsideFolderNamed(file, "test") || isInsideFolderNamed(file, "test_driver") || config.allowTestsOutsideTestFolder)
If you want to have tests outside of test/test_driver, you need to set the dart.allowTestsOutsideTestFolder setting
DanTupToday at 12:48 PM
though arguably if integration_test is a common folder, we should add that to the list
DanTupToday at 12:54 PM
Ah, I see - so it looks like you need to run the tests using flutter drive. Since you changed that setting, we would now be running with flutter test. I think it's going to need some work to properly support this
DanTupToday at 12:55 PM
I think we should detect tests inside integration_test and run them with flutter drive, and maybe have a flutterDriveAdditionalArgs or similar
Great, thanks!
How are you running from the terminal? Is it like this?
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/foo_test.dart \
-d <DEVICE_ID>
I guess we need to have a way to find the test_driver script (perhaps by convention, if it exists with that name?)
bsr203Today at 12:59 PM
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d android --flavor dev
DanTupToday at 1:00 PM
Got it. The docs seem to suggest using that path for the driver script, so I think we can assume if that file exists and the current file is in integration_test, then we can run it like this. Thanks!
key finding are:
dart-code uses folder to decide test. integration_test is not in the list, but is currently recommended by flutter docs.
integration test uses flutter drive command, so code lens need to use it instead of flutter test for integration tests.
integration test needs to honor flutterTestAdditionalArgs, or need similar flag to pass arguments
Activity
[-]Integration test with `flutter drive` command[/-][+]Integration test with integration_test package[/+]bsr203 commentedon Dec 15, 2020
updating with some of the comments from @DanTup
bsr203 commentedon Dec 15, 2020
key finding are:
dart-code uses folder to decide test.
integration_testis not in the list, but is currently recommended by flutter docs.integration test uses
flutter drivecommand, so code lens need to use it instead offlutter testfor integration tests.integration test needs to honor
flutterTestAdditionalArgs, or need similar flag to pass argumentsRecognise "integration_test" folder as tests that require a device
Recognise "integration_test" folder as tests that require a device
Recognise "integration_test" folder as tests that require a device
Recognise "integration_test" folder as tests that require a device