Skip to content

Cannot run Test through extension in LeetCode endpoint #455

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

Closed
shanerbo opened this issue Oct 9, 2019 · 10 comments · Fixed by leetcode-tools/leetcode-cli#29
Closed

Cannot run Test through extension in LeetCode endpoint #455

shanerbo opened this issue Oct 9, 2019 · 10 comments · Fixed by leetcode-tools/leetcode-cli#29
Labels
bug Something isn't working
Milestone

Comments

@shanerbo
Copy link

shanerbo commented Oct 9, 2019

updated by @jdneo:

For anyone has this issue, please see #455 (comment) as a workaround.


Keep getting error message:

c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\commands\test.js:93
results[0].stdout = results[0].stdout.slice(1, -1).replace(/\n/g, '\n');
^

TypeError: Cannot read property 'slice' of undefined
at c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\commands\test.js:93:45
at _cb (c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\plugins\retry.js:45:21)
at Queue.onDone (c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js:304:14)
at Queue.workerRun (c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\queue.js:37:12)
at Immediate. (c:\Users\Erbo.vscode\extensions\shengchen.vscode-leetcode-0.15.6\node_modules\vsc-leetcode-cli\lib\queue.js:47:36)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)

@jdneo

This comment has been minimized.

@sunmiaozju
Copy link

I also meet this problem just now, and it seems like all the problems can not run Test
But also can run submit
@jdneo

@yogain123
Copy link

yogain123 commented Oct 9, 2019

Yes same with me, using the latest version of the extension but still problem exists
Exact Same error I am also facing

@Lam9090
Copy link

Lam9090 commented Oct 9, 2019

@jdneo I found that it seems like this condiction not passed when runing test.
image
After i replace the interpret by runcode,thoese test work as before .

@jdneo
Copy link
Member

jdneo commented Oct 9, 2019

@lintuming Thank you for investigating. Seems LeetCode changes its response AGAIN!!!!

That's what I could not foresee. Will try to update the cli recently

@jdneo jdneo pinned this issue Oct 9, 2019
@tinvaan
Copy link

tinvaan commented Oct 9, 2019

Sorry to add to the noise guys, but yeah I have the same issue as well :)

- Sending code to judge
- Waiting for judge result
- Waiting for judge result
- Waiting for judge result
- Waiting for judge result
- Waiting for judge result
- Waiting for judge result
- Waiting for judge result
  ✔ Finished
/home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/commands/test.js:93
      results[0].stdout = results[0].stdout.slice(1, -1).replace(/\\n/g, '\n');
                                            ^

TypeError: Cannot read property 'slice' of undefined
    at /home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/commands/test.js:93:45
    at _cb (/home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/plugins/retry.js:45:21)
    at Queue.onDone (/home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/plugins/leetcode.js:304:14)
    at Queue.workerRun (/home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/queue.js:37:12)
    at Immediate.<anonymous> (/home/harish/.vscode-oss/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/lib/queue.js:47:36)
    at processImmediate (internal/timers.js:439:21)

@jdneo
Copy link
Member

jdneo commented Oct 9, 2019

This bug is because LeetCode updated the content of the response body, so the CLI part is broken.

Before I release the fix, you can manually modify the file at: $home/.vscode/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/*⁩ just the same as the PR I referenced above.

@jdneo jdneo added the bug Something isn't working label Oct 9, 2019
@yogain123
Copy link

@jdneo It's working now, Thanks

@jdneo jdneo changed the title Cannot run Test through extension both my desktop and mbp Cannot run Test through extension in LeetCode endpoint Oct 9, 2019
@jdneo jdneo added this to the 0.15.7 milestone Oct 9, 2019
@tinvaan
Copy link

tinvaan commented Oct 9, 2019

This bug is because LeetCode updated the content of the response body, so the CLI part is broken.

Before I release the fix, you can manually modify the file at: $home/.vscode/extensions/shengchen.vscode-leetcode-0.15.6/node_modules/vsc-leetcode-cli/*⁩ just the same as the PR I referenced above.

Hey just noticed the last release was only 2 days ago. Any idea when you might roll out the next release including this fix?

@jdneo
Copy link
Member

jdneo commented Oct 10, 2019

@tinvaan I've released a new version yesterday.

@jdneo jdneo unpinned this issue Oct 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants