-
Notifications
You must be signed in to change notification settings - Fork 4.1k
test: migrate all packages from Flutter driver to integration tests #9649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: migrate all packages from Flutter driver to integration tests #9649
Conversation
| flutter_test: | ||
| sdk: flutter | ||
| plugin_platform_interface: ^2.0.0 | ||
| test: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the test dependencies in all packages (except _flutterfire_internals) because the packages already have flutter_test as a dependency. Or is there a reason why we have two test dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me I think.
| import 'package:integration_test/integration_test_driver.dart'; | ||
|
|
||
| Future<void> main() => integrationDriver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the tests of flutterfire used? They are not in the CI, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have integration tests for flutterfire_ui if that is your question 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there are some tests in example folder of the flutterfire_ui 🤔 https://github.com/firebase/flutterfire/tree/master/packages/flutterfire_ui/example/test_driver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, they aren't part of our CI e2e tests. I think you can leave them for now and we'll integrate them at some other point. Unless @lesnitsky thinks otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add them as well? If yes, I can make a new issue and integrate them in a separate PR into our CI 👍
tests/integration_test/firebase_auth/firebase_auth_multi_factor_e2e_test.dart
Show resolved
Hide resolved
| @@ -1,898 +0,0 @@ | |||
| // ignore_for_file: require_trailing_commas | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the tests from the firebase_auth from packages/firebase_auth/firebase_auth/example/ because the source of truth should be in tests, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. Double check with @Salakar as he set it up and might have a reason why e2e tests remain in example app.
| }, | ||
| // Android skip because it's flaky. See: | ||
| // https://github.com/firebase/flutterfire/issues/9652 | ||
| skip: defaultTargetPlatform == TargetPlatform.android, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping this test because it's flaky. See: #9652
| // Android skipped because it times out with a likelihood of 98%. See: https://github.com/firebase/flutterfire/issues/9651 | ||
| skip: kIsWeb || | ||
| defaultTargetPlatform == TargetPlatform.macOS || | ||
| defaultTargetPlatform == TargetPlatform.android, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android skipped because it times out with a likelihood of 98%. See: #9651
| // Android skipped because it times out with a likelihood of 98%. See: https://github.com/firebase/flutterfire/issues/9650 | ||
| skip: kIsWeb || | ||
| defaultTargetPlatform == TargetPlatform.macOS || | ||
| defaultTargetPlatform == TargetPlatform.android, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android skipped because it times out with a likelihood of 98%. See: #9650
russellwheatley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM provided a couple of questions I'm not sure on are answered by the rest of the core team. Good work, @nilsreichardt 🎉
| flutter_test: | ||
| sdk: flutter | ||
| plugin_platform_interface: ^2.0.0 | ||
| test: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me I think.
| import 'package:integration_test/integration_test_driver.dart'; | ||
|
|
||
| Future<void> main() => integrationDriver(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have integration tests for flutterfire_ui if that is your question 😄
| @@ -1,898 +0,0 @@ | |||
| // ignore_for_file: require_trailing_commas | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. Double check with @Salakar as he set it up and might have a reason why e2e tests remain in example app.
This comment was marked as outdated.
This comment was marked as outdated.
Half of the migration has already been reviewed in #9230 (see #8910, #8946, #8938, #8972, #8975, #8974, #8978, #8973, #8977). However, cherry-picking the commits in separate branches should be relatively easy because I committed in very small steps. Is still preferred? Yes, I can do this 👍 |
| import 'query_reference_test.dart' as query_reference_test; | ||
|
|
||
| void main() { | ||
| IntegrationTestWidgetsFlutterBinding.ensureInitialized(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik this isn't required, because the flutter tool creates a temporary file where the call to IntegrationTestWidgetsFlutterBinding.ensureInitialized() is automatically inserted. See flutter/flutter#92254 for more details :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note, @bartekpacia. However, it seems that without IntegrationTestWidgetsFlutterBinding.ensureInitialzed() the tests doesn't on web. Maybe it's related with flutter/flutter#66264
See:
…d()`" This reverts commit f117e20.
|
Reviewed carefully and everything seems fine. Some files are deleted because they were duplicates not being used anymore. LGTM |
| cd .github/workflows/scripts | ||
| firebase emulators:start --only auth,firestore,functions,storage,database --project flutterfire-e2e-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have the melos run firebase:emulator than can be used
Description
The
integration_testpackage is the new way to write e2e tests. Therefore, this PR migrates the tests from driver tests to integration tests.As side effect, we see that the Android CI e2e tests pipeline is way more stable.
Screen.Recording.2022-10-02.at.11.05.28.mov
ToDos:
cloud_firestorecloud_functionsfirebase_analyticsfirebase_app_installationsfirebase_authfirebase_corefirebase_crashlyticsfirebase_databasefirebase_dynamic_linksfirebase_in_app_messagingfirebase_ml_model_downloaderfirebase_remote_configfirebase_messagingfirebase_storagecloud_firestore_odmfirebase_performanceflutterfire_uicloud_functionsFlutter driver tests (inpackages/cloud_functions/cloud_functions/example)firebase_analyticsFlutter driver tests (inpackages/firebase_analytics/firebase_analytics/example)firebase_authFlutter driver tests (inpackages/firebase_auth/firebase_auth/example)firebase_coreFlutter driver tests (inpackages/firebase_core/firebase_core/example)driveas dependencydrivedependency on pub.dev as discontinued?Related Issues
Closes #8909
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?