Move analyzer test utilities to analyzer_utilities package #55660
Labels
area-analyzer
Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
P2
A bug or feature request we're likely to work on
type-code-health
Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable
Quick background / example: I would like to move
ResolveNameInScopeTest
from the analyzer package to the linter package. But it depends onAbstractLinterContextTest
(also inpkg/analyzer/test
) which depends on PubPackageResolutionTest (also inpkg/analyzer/test
). So I cannot move any tests until we have some shared base classes. Or I can copy swaths of code.Creating shared testing code between the analyzer package, linter package, analysis_server and analysis_server_plugin packages is necessary for the plugins story. CC @bwilkerson @scheglov @pq
ContextResolutionTest
It would take significant investigation to determine how many test utility classes and mixins would be prudent to move. But as a starting place, I think it would be of huge benefit to move
ContextResolutionTest
intopackage:analyzer_utilities
. How do we get there?ResourceProviderMixin
ResourceProviderMixin
(mixed intoContextResolutionTest
) is declared inpackage:analyzer/src/test_utilities
, so we're already in a good place there. Should be easier to move than other things, as it cannot depend on code inpkg/analyzer/test
. This might be the best starting place.ResolutionTest
ContextResolutionTest
also mixes inResolutionTest
, so this is also a pre-requirement. Unfortunately it lives inpkg/analyzer/test
, and is in a file which imports eight other files frompkg/analyzer/test
. Yikes.PubPackageResolutionTest
PubPackageResolutionTest
is also an important base class, as it is the base for supporting analysis options files and package configs.The text was updated successfully, but these errors were encountered: