-
Notifications
You must be signed in to change notification settings - Fork 340
DevTools extensions don't load for a test ran with flutter test
or dart test
#7183
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
Comments
What is odd is that the Flutter sidebar DevTools menu properly detects the foo extension even though DevTools itself cannot: We get the app root directly from VS code in the sidebar case: https://github.com/flutter/devtools/blob/master/packages/devtools_app/lib/src/standalone_ui/vs_code/debug_sessions.dart/#L166 Whereas in DevTools itself, we try to get the URI from the isolate: @DanTup how are you passing the proper URI for the debug session, and is this something we can get on the DevTools side too from the VM service? |
VS Code knows where the root of the project is because when we start a debugging session we need to work out where the project root is to know if it's a Dart/Flutter project. So against the debug session information, we keep track of this (and we include it when we tell the sidebar a debug session started). I guess we could pass this info along to DevTools somehow, but I'm not sure what the best way would be (because it's tied to a specific debug session). We could perhaps provide the running debug sessions to DTD and include this, or we could perhaps include it when we tell the DevTools server about the VM Services: (We currently call |
We could also perhaps include it on the querystring if we're launching DevTools I think? |
The one problem with having the IDEs pass in a value somehow is that this also needs to work in the command line case where a user is running a test with |
The right thing is probably to have both |
When I printed out all the isolates DevTools was aware of, there was only one available. |
Which one? The |
flutter test
flutter test
or dart test
flutter test test/app_that_uses_foo_test.dart --start-paused
, thepackage:foo
DevTools extension does not loadflutter run test/app_that_uses_foo_test.dart --start-paused -d flutter-tester
, thepackage:foo
DevTools extension does load.In the
flutter test
case,rootLibraryForMainIsolate
is returning file:///var/folders/gf/14ctmb656m3100h5z857669800fv4z/T/flutter_tools.9i1YVt/flutter_test_listener.ASUv35/listener.dart, whereas in theflutter run
case it returns the expected path to the test file.Since we have DevTools extensions intended for test files (e.g. Patrol), we should fix this and cherry pick to stable.
CC @bkonyi @DanTup for any ideas you have on how we can get the proper root lib or isolate for the
flutter test
case.The text was updated successfully, but these errors were encountered: