Open cec opened 3 years ago
I have the same issue. Here's a log from the Developer Tools if that's any help:
notificationsAlerts.ts:40 Error while debugging test: SyntaxError: Unexpected end of JSON input
onDidChangeNotification @ breadcrumbsModel.ts:39
(anonymous) @ breadcrumbsModel.ts:39
fire @ event.ts:584
addNotification @ notifications.ts:204
notify @ notificationService.ts:88
(anonymous) @ mainThreadLogService.ts:16
_showMessage @ mainThreadLogService.ts:16
$showMessage @ mainThreadLogService.ts:16
_doInvokeHandler @ rpcProtocol.ts:365
_invokeHandler @ rpcProtocol.ts:365
_receiveRequest @ rpcProtocol.ts:306
_receiveOneMessage @ rpcProtocol.ts:174
(anonymous) @ rpcProtocol.ts:105
fire @ event.ts:584
fire @ ipc.net.ts:431
_receiveMessage @ ipc.net.ts:764
(anonymous) @ ipc.net.ts:624
fire @ event.ts:584
acceptChunk @ ipc.net.ts:174
(anonymous) @ ipc.net.ts:174
t @ ipc.net.ts:900
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
Can add that I have the same issue using Minitest instead of RSpec.
But then it went away presumably from auto-updates.
~It's back!~
~Does anyone have specific instructions on how to debug the extension? I'd be happy to dig into this.~
Nevermind, there was already a server running on port 1234.
killall ruby
does the trick. And
lsof -i :1234
will find what's using that port on a Mac (or Linux, I think)
@StefanoDeVuono the Contributing section should have everything you need, I think: https://github.com/connorshea/vscode-ruby-test-adapter#contributing
I have this issue as well, with rspec
I've the same problem. How can I solve that?
"SyntaxError: Unexpected end of JSON input"
I use the ruby "debug". It only appears when using all tests in a file single tests are working fine
The problem appear in this function getDebugCommand(debuggerConfig: vscode.DebugConfiguration, args: string)
in this specific line -- ${process.platform == 'win32' ? '%EXT_DIR%' : '$EXT_DIR'}/debug_rspec.rb ${args}
debug_rspec.rb
is not the right file to run. You must find the correct file to run.
Setting "rubyTestExplorer.debugCommand": "bundle exec rdebug-ide"
resolved this issue for me.
I will try to make a PR but I don't have the bandwidth at the moment. Fix is to change this:
from
runTestFile = async (testFile: string, debuggerConfig?: vscode.DebugConfiguration) => new Promise<string>(async (resolve, reject) => {
this.log.info(`Running test file: ${testFile}`);
const spawnArgs: childProcess.SpawnOptions = {
cwd: this.workspace.uri.fsPath,
shell: true
};
to
runTestFile = async (testFile: string, debuggerConfig?: vscode.DebugConfiguration) => new Promise<string>(async (resolve, reject) => {
this.log.info(`Running test file: ${testFile}`);
const spawnArgs: childProcess.SpawnOptions = {
cwd: this.workspace.uri.fsPath,
shell: true,
this.getProcessEnv()
};
Your environment
vscode-ruby-test-adapter
version: 0.8.0Expected behavior
Selecting a rspec example group from the test explorer panel and clicking the debug icon should run the example group with debugging enabled.
Actual behavior
I get an popup with the error:
In the output panel, if I select
Ruby Test Explorer Log
I see the following when trying to debug geolocation_utils_spec.rbI apologize in advance if this is a stupid setup mistake on my end, but I'm new to VS Code as a IDE, since before I could work on a linux desktop and I used RubyMine.
This extensions is absolutely amazing! I can't thank you enough for it.