-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support debugging individual Prism tests in VS Code #311
Conversation
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.
Thank you @st0012 and @amomchilov 🫶
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.
A bit late toeh party, but I left some comments
"preLaunchTask": "Prepare tests debugging", | ||
"stopOnEntry": false, | ||
"sourceMap": { | ||
"${env:BAZEL_EXEC_ROOT}": "${workspaceFolder}", |
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.
Nice.
{ | ||
"label": "Prepare tests debugging", | ||
"type": "shell", | ||
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root)", |
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.
IIRC it's beneficial to use the same configuration here, otherwise the Bazel server restarts
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root)", | |
"command": "export BAZEL_EXEC_ROOT=$(./bazel info execution_root --config=dbg)", |
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.
Does bazel info
requires starting a server? I tried running it manually with/out the flag and I don't see any difference.
{ | ||
"id": "test_name", | ||
"type": "promptString", | ||
"description": "Enter the test name, e.g. case for running test/prism_regression/case.rb", |
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.
Should we add a default
, to give an example input?
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.
Also, is there an equivalent to this:
Lines 41 to 45 in bab4eb4
// With this option, when running this task with the `Tasks: Rerun Last Test` command, it'll | |
// reuse the previous run's input, rather than prompting for it again | |
"runOptions": { | |
"reevaluateOnRerun": false | |
} |
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.
Motivation
This is based on @amomchilov's prior work in prism...Shopify:sorbet:Alex/vscode-debugging
Debugging.Sorbet.Prism.tests.in.VS.Code.mp4
I'll also add this to #279 so we remove these stuff before upstreaming.
Test plan
See included automated tests.