Repository navigation
[flutter_analyzer_plugin] Migrate unit tests off package:test_reflective_loader - #193017
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the unit tests in dev/flutter_analyzer_plugin from test_reflective_loader to standard package:test unit tests, updating the documentation and removing the unused dependency. Feedback suggests avoiding the cascade operator ..setUp() in test setups to prevent potential asynchronous safety issues and error masking.
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
Thanks for the cleanup! |
….dart to package:test
|
@bkonyi – sorry. will need another nod from you. |
Removes the
test_reflective_loaderdev_dependency (and its transitivedart:mirrorsdependency) fromdev/flutter_analyzer_plugin, migrating all 18 test files to standardpackage:testtest('...', () async { ... })blocks.Motivation
package:test_reflective_loaderrelies ondart:mirrorsto discover@reflectiveTestclasses and invoketest_*()methods at runtime.package:analyzer_testing(AnalysisRuleTest->PubPackageResolutionTest->AbstractContextTest) has zero runtime dependency ontest_reflective_loader—it only providessetUp()andtearDown()lifecycle hooks.defineReflectiveTests(...)and class-leveltest_*()methods with standardsetUp/tearDown+test('...', () async { ... })closures inmain():test_reflective_loader(anddart:mirrors) fromflutter/flutter's dependency tree (pubspec.lock/package_config.json), unblocking Dart 4dart:mirrorsremoval.// ignore: unreachable_from_main, non_constant_identifier_nameslint suppressions across the test suite.+524 / -524lines across 21 files).dev/flutter_analyzer_plugintests directly viaflutter test dev/flutter_analyzer_plugin(previously blocked becauseflutter testdisablesdart:mirrors).Pre-launch Checklist
///).