-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix Dart plugin registrant interaction with 'flutter test' #90288
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
Fix Dart plugin registrant interaction with 'flutter test' #90288
Conversation
|
/cc @blasten It still needs unit tests, and I haven't run all the unit tests yet to see if I need to adjust other test setup, but I've verified that this fixes the e2e test (as well as testing various orderings of build/run/test/drive manually). Feel free to take an early look if you like. |
blasten
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.
got it. Changes LGTM
|
@blasten I added a unit test, and the other tests seems happy, so this is ready for review. |
| expect(generatedMain, exists); | ||
| expect( | ||
| generatedMain.readAsStringSync(), | ||
| contains("import 'test/foo.dart' as entrypoint;") |
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.
what if someone changes the generated code to // import 'test/foo.dart' as entrypoint;?
could we ensure the entire output?
blasten
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
|
Will this PR also fix We have an issue where our tool runs |
|
This pull request is not suitable for automatic merging in its current state.
|
I doubt it; I didn't intentionally change anything for the
Please file an issue with detailed repro steps and @-mention me; the |
|
|
…0288) Building an application for a desktop platform that transitively included any Dart-based plugins (such as path_provider) broke `flutter test`, because its compilation was overriding the provided main (in this case, the test main) with `generated_main.dart` if it was present. This PR: - Changes the `flutter test` compilation path to update `generated_main.dart`, so that the tests will work, and will include any registered Dart plugins. - Makes using `generated_main.dart` during recompile opt-in, to try to reduce the chance of a similar bug happening with other codepaths in the future. Fixes flutter#88794
Building an application for a desktop platform that transitively included any Dart-based plugins (such as path_provider) broke
flutter test, because its compilation was overriding the provided main (in this case, the test main) withgenerated_main.dartif it was present. This PR:flutter testcompilation path to updategenerated_main.dart, so that the tests will work, and will include any registered Dart plugins.generated_main.dartduring recompile opt-in, to try to reduce the chance of a similar bug happening with other codepaths in the future.Fixes #88794
Pre-launch Checklist
///).