Fix Dart plugin registrant interaction with 'flutter test'#90288
Fix Dart plugin registrant interaction with 'flutter test'#90288stuartmorgan-g merged 7 commits intoflutter:masterfrom
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 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.
what if someone changes the generated code to // import 'test/foo.dart' as entrypoint;?
could we ensure the entire output?
|
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
///).