Skip to content
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

Generated instructions in automated test can't execute correctly on Windows #1996

Closed
Super-Xray opened this issue Apr 30, 2024 · 4 comments · Fixed by #2109
Closed

Generated instructions in automated test can't execute correctly on Windows #1996

Super-Xray opened this issue Apr 30, 2024 · 4 comments · Fixed by #2109
Assignees
Labels
bug Something isn't working help-wanted Extra attention is needed

Comments

@Super-Xray
Copy link
Contributor

Super-Xray commented Apr 30, 2024

Description

Reproduction steps

  1. Start the Ruby LSP using a certain editor
  2. Open the ruby test file(for example test\requests\definition_expectations_test.rb)
  3. click run in terminal attached to a test function
  4. the instruction is like bundle exec ruby -Itest xxx/test/requests/definition_expectations_test.rb --name DefinitionExpectationsTest\#test_jumping_to_method_definitions_when_declaration_exists
  5. output is not correct:

Code snippet or error message

# Running tests with run options --name DefinitionExpectationsTest\#test_jumping_to_method_definitions_when_declaration_exists --seed 868:



Finished tests in 0.001863s, 0.0000 tests/s, 0.0000 assertions/s.


0 tests, 0 assertions, 0 failures, 0 errors, 0 skips

but If I modifed the instruction into bundle exec ruby -Itest xxx/test/requests/definition_expectations_test.rb --name DefinitionExpectationsTest#test_jumping_to_method_definitions_when_declaration_exists (just delete a '\')
and then, the ouput is better:

# Running tests with run options --name DefinitionExpectationsTest#test_jumping_to_method_definitions_when_declaration_exists --seed 47762:

.

Finished tests in 0.050074s, 19.9706 tests/s, 19.9706 assertions/s.


1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

The os is win11, I run it on VSCode 1.88.1. The extension edition is v0.5.20. But the starting info in the output window is Initializing Ruby LSP v0.16.7,I'm not very sure the role of edition in this phenomenon. I hope somebody can check it. Thanks!

@Super-Xray Super-Xray added the bug Something isn't working label Apr 30, 2024
@andyw8
Copy link
Contributor

andyw8 commented Apr 30, 2024

Thanks for the report. We're using Shellwords.escape but this is intended for the Bourne shell, so probably isn't a valid approach for Windows. We'll need to look into that.

@andyw8 andyw8 changed the title Generated instructions in automated test can't execute correctly Generated instructions in automated test can't execute correctly on Windows Apr 30, 2024
@andyw8 andyw8 self-assigned this May 30, 2024
@andyw8 andyw8 added the help-wanted Extra attention is needed label May 30, 2024
@andyw8
Copy link
Contributor

andyw8 commented May 30, 2024

@Super-Xray Can you try this branch please? #2109

@Super-Xray
Copy link
Contributor Author

Sure!

@Super-Xray
Copy link
Contributor Author

I think this problem has been solved. Thanks! @andyw8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help-wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants