-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Proof Of Concept: Alternate debug #929
Conversation
If we think this is a good idea, we should update to handle No tests yet. Also, I wonder if we couldn't implement a simple proxy layer for the debug protocol that avoided the need for existing tools to implement automatic reconnection. |
It looks like all we would have to do is proxy it and prevent the connection from the debugger from closing: https://github.com/nodejs/node/blob/master/lib/_debugger.js#L1704 |
This works well with
Works pretty well. |
For non-IDE users it will be simpler than #874 . But IDE user relies on IDE and for IDE it ts better to use standard, tool-agnostic way :) This PR:
I have no relation to AVA, and I will not use this (because I am IDE user), but as happy AVA user I am glad that AVA will be suited for all, 👍 |
} | ||
|
||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything we can request from Node.js to make this easier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not Node.
But I have ideas for meow
: sindresorhus/meow#44
👍 Very nice! I tried it out and works great :) |
I've tried this branch with webstorm and for this to work I had to accept another command line option: This is something specific to webstorm, see: nodejs/node#7102 I wonder whether the code specific to Instead of var api = new Api({
execArgv: ... These options will then be passed directly to It would be nice if these extra arguments would not have to be specifically specified, this would enable any node parameter to be passed along and let the error handling be handled by the node cli itself. To do this, perhaps make sure all options are covered by the type list ( And then use this list to filter the command line arguments and pass any unknowns using the new |
@rhalff Please specify WebStorm version. Due to nodejs changes, WebStorm < 2016.1 doesn't support NodeJS 6+ (explicit |
@develar I'm using WebStorm 2016.2 (Build #WS-162.1121.31, built on July 9, 2016) It seems webstorm 2016.2 includes I've created a branch here: master...rhalff:exec-argv-increase-debug-port which will increase the port number on each fork and pass any other node command line argument as is. Webstorm is configured like this: Webstorm itself will then detect the debug port for each child process: I'm not sure this is a universal fix though and whether the automatic detection of the extra debug port is something specific to webstorm only. e.g. If I run the same command from the command line only one port is reported. n.b. the |
@rhalff Thanks for clarification, if you use WebStorm, please use another PR #874 (comment) This PR is not about IDE support. |
Can this be made to work with |
Would love to see this merged soon 👍 |
To recap, this adds a I think we should support We'd need to check if the inspector URL is the same for each child process. The user would still have to reload the browser window every time a new child process is started. Ultimately perhaps we can use a proxy to inject an AVA experience into the inspector ;-) @jamestalmage any thoughts on the above? What's your work load like? Should this be closed and punted to an issue instead? |
4bc021e
to
476c653
Compare
8610723
to
4acb78f
Compare
Closing due to inactivity. @jamestalmage has been incredibly busy. If anybody wishes to take this on please comment. |
Does anyone here as ever succeed to debug an ava test in Atom? I've been using a debugger in Atom for a while, but debugging tests has been a headache since. Thanks. |
Alternate to #874
Possibly Fixes #342
I have tested this locally, and it seems to just work.
Run with:
In a separate terminal:
You can see the list of available commands by typing
help
.Once the first test terminates, you do need to type
run
to reconnect the debugger between tests. I think we could requestnode debug
add a flag to automatically reconnect (still, I don't know why you would want to debug multiple test files, and typingrun
a few times isn't that bad). It seems like auto-reconnect would be much easier for existing tools to implement instead of parsing stderr`.