-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -22,6 +22,26 @@ | |||||||||||
"ignoreFailures": false | ||||||||||||
} | ||||||||||||
] | ||||||||||||
}, | ||||||||||||
{ | ||||||||||||
"type": "lldb", | ||||||||||||
"request": "launch", | ||||||||||||
"name": "Debug Prism test in LLDB", | ||||||||||||
"program": "${workspaceFolder}/bazel-bin/test/test_PosTests/prism_regression/${input:test_name}.runfiles/com_stripe_ruby_typer/test/pipeline_test_runner", | ||||||||||||
"args": ["--single_test=${workspaceFolder}/test/prism_regression/${input:test_name}.rb", "--parser=prism"], | ||||||||||||
// See .vscode/tasks.json for the task that sets the `BAZEL_EXEC_ROOT` environment variable. | ||||||||||||
"preLaunchTask": "Prepare tests debugging", | ||||||||||||
"stopOnEntry": false, | ||||||||||||
"sourceMap": { | ||||||||||||
"${env:BAZEL_EXEC_ROOT}": "${workspaceFolder}", | ||||||||||||
}, | ||||||||||||
}, | ||||||||||||
], | ||||||||||||
"inputs": [ | ||||||||||||
{ | ||||||||||||
"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 commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||
} | ||||||||||||
] | ||||||||||||
} | ||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -69,6 +69,23 @@ | |||||
"reveal": "always" | ||||||
} | ||||||
}, | ||||||
// This task: | ||||||
// - Runs tests to generate the pipeline_test_runner files, which are needed by the LLDB | ||||||
// debugger to execute the tests. | ||||||
// - Sets the `BAZEL_EXEC_ROOT` environment variable, which is used by the LLDB | ||||||
// debugger to find the source files. | ||||||
{ | ||||||
"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 commentThe 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
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does |
||||||
// We need to run tests first to get the pipeline_test_runner files generated | ||||||
// Just building Sorbet with Prism doesn't generate them. | ||||||
"dependsOn": ["Run all Prism tests"], | ||||||
"hide": true, | ||||||
"presentation": { | ||||||
"reveal": "never", | ||||||
} | ||||||
} | ||||||
], | ||||||
"inputs": [ | ||||||
{ | ||||||
|
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.