Skip to content
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

Replace broken Observatory URL with DevTools URL #2185

Open
kenzieschmoll opened this issue Feb 13, 2024 · 10 comments
Open

Replace broken Observatory URL with DevTools URL #2185

kenzieschmoll opened this issue Feb 13, 2024 · 10 comments

Comments

@kenzieschmoll
Copy link

When running a test with dart test foo_test.dart --pause-after-load, the following is printed to the CLI:

 dart test test/dart_test/b_example_test.dart --pause-after-load
...
00:01 +0: loading test/dart_test/b_example_test.dart                                                  
Observatory URL: http://127.0.0.1:51715/1m3AdwIltJ4=/#/inspect?isolateId=isolates%2F3973115144356875&objectId=libraries%2F%4019317648
The test runner is paused. Open the Observatory and set breakpoints. Once you're finished, return to
this terminal and press Enter.

This URL is broken. DevTools is also unavailable from this state because there is not a DDS instance.

We should fix this so that when running a test with dart test for debugging, DevTools is served properly and the user can access if from a URL printed to CLI (Flutter tools does this properly for flutter test).

CC @jakemac53 @bkonyi

@kenzieschmoll
Copy link
Author

This is important for the work to support DevTools extensions for dart tests: flutter/devtools#7183.

@bkonyi
Copy link
Contributor

bkonyi commented Feb 13, 2024

This will require two changes:

  1. We need to be able to serve DDS and DevTools from dart test (this currently isn't configured)
  2. We need to update something in package:test* to print the right message.

For 1), @a-siva is currently working on a CL to launch DDS (and also serve DevTools) from the VM service isolate instead of from DartDev, so we'll get this for free once that work is done.

For 2), changing the messaging should be easy enough, but I'm not sure we'll be able to mimic the prior behavior since the DevTools debugger doesn't support navigating to a library based on a query parameter like Observatory does.

@kenzieschmoll
Copy link
Author

For 2), changing the messaging should be easy enough, but I'm not sure we'll be able to mimic the prior behavior since the DevTools debugger doesn't support navigating to a library based on a query parameter like Observatory does.

I think this is okay. The user can decide what type of debugging they want to do once they get into DevTools.

@bkonyi
Copy link
Contributor

bkonyi commented Feb 13, 2024

For 2), changing the messaging should be easy enough, but I'm not sure we'll be able to mimic the prior behavior since the DevTools debugger doesn't support navigating to a library based on a query parameter like Observatory does.

I think this is okay. The user can decide what type of debugging they want to do once they get into DevTools.

Sure, but it definitely won't be as user friendly since navigating to the debugger will dump the user in the root library which will be generated code. Not the end of the world (especially considering this link has been broken for over a year now and no one filed an issue), but it's not the ideal UX.

@jakemac53
Copy link
Contributor

I am not worried about losing some behavior today, because it sounds like the current thing doesn't work at all?

@bkonyi
Copy link
Contributor

bkonyi commented Feb 13, 2024

I am not worried about losing some behavior today, because it sounds like the current thing doesn't work at all?

For sure. Getting something working is better than nothing, but we might want to fix this UX in the future if anyone actually uses it and complains... :-)

@natebosch
Copy link
Member

  1. We need to be able to serve DDS and DevTools from dart test (this currently isn't configured)

Has this been resolved?

2. We need to update something in package:test* to print the right message.

What is the correct Uri for dev tools generally? If we cannot deep link to the library I think we can resolve that later.

@bkonyi
Copy link
Contributor

bkonyi commented May 13, 2024

  1. We need to be able to serve DDS and DevTools from dart test (this currently isn't configured)

Has this been resolved?

It doesn't look like moving the DDS launch logic to the VM service handles the Service.webServerControl(...) flow. We'll need to do that before this will work.

  1. We need to update something in package:test* to print the right message.

What is the correct Uri for dev tools generally? If we cannot deep link to the library I think we can resolve that later.

This might be context dependent at this point.

For the standalone VM, the URI is always of the form http://<path>/devtools/debugger?uri=ws://<path>/ws, where path is the address, port, and optional auth code for DDS. That URI will open to the debugger page in DevTools with the main isolate selected; there's currently no way to select isolates via query parameters.

For flutter test, I'm not 100% sure. Right now flutter_tools is spinning up its own DevTools server rather than using the one hosted by DDS. I'm working on changing this to be more consistent with the standalone VM, but that change is currently blocked by some other work.

@bkonyi
Copy link
Contributor

bkonyi commented May 14, 2024

  1. We need to be able to serve DDS and DevTools from dart test (this currently isn't configured)

Has this been resolved?

It doesn't look like moving the DDS launch logic to the VM service handles the Service.webServerControl(...) flow. We'll need to do that before this will work.

This will be resolved once https://dart-review.googlesource.com/c/sdk/+/366560 lands.

@bkonyi
Copy link
Contributor

bkonyi commented Jun 25, 2024

The above CL has landed, so we can now serve DDS and DevTools from dart test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants