Review test running associated commands
We added specific commands to be able to run tests, but after double-checking the default keybindings I realized that this is already possible out of the box.
There are several commands to run or debug tests, like
- testing.debugAll
- testing.runAll
- testing.debugAtCursor
- testing.runCurrentFile
- testing.runAtCursor
- testing.reRunLastRun
- testing.reRunFailTests
I don't think we needed the implementation from Shopify/vscode-ruby-lsp#696 and I don't believe we need the implementation from Shopify/vscode-ruby-lsp#708 and Shopify/vscode-ruby-lsp#717.
Let's confirm that this is the case and
- Revert the changes in Shopify/vscode-ruby-lsp#696
- Document what the default keybindings for interacting with the test explorer are somewhere. People can easily change their keybindings if they want to
I verified these work when called from the command menu:
- testing.runAtCursor
- testing.debugAtCursor
- testing.runCurrentFile
- testing.reRunFailTests (odd that it's
failand notfailed) - testing.reRunLastRun
testing.runAll also works, but for our extension I don't think there would be any difference than testing.runCurrentFile, since the explorer only covers the currently active file.
Something else I noticed - many of these already have keybindings. They use Command-; like a modifier, e.g. to re-run the last test it's Command-; followed by l.
The one that doesn't work currently is testing.debugAll but that doesn't seem very useful.
This issue is being marked as stale because there was no activity in the last 2 months
I find the rubyLsp.runTestInTerminal command useful because:
- I can run all tests in the current file by triggering it on my top level
describe/contextblock. This is much faster than running via test explorer, which seems to start a new process for each individual test. - I can make edits while the tests are running, e.g. if I see an error start to occur and I know what fix I want to implement before the run has finished
- I find the output more useful - when I run via test explorer, I don't see errors in the Test Results panel unless I specifically click on a failed test in there (extra clicks). Or if I have the "peek view" enabled, but I find that very visually confusing because now my error output is inserted into the document I'm trying to edit. I don't know if there's a way to fix this, and I haven't investigate how it works on other language platforms, so maybe it can be improved.
I'd like to have something equivalent to rubyLsp.runTestInTerminal that:
- Runs the entire test file (i.e. no
:XXline number suffix) -- equivalent totesting.runCurrentFile - Re-runs the last test run (either entire file or specific line) -- equivalent to
testing.reRunLastRun
Thanks for the suggestions, those are great ideas. It's not well described in the issue, but the idea was just to avoid the duplication for the test explorer commands, which already exist and yet we created duplicates for.
For run in terminal, indeed having those new commands would be great.
Because run in terminal is now associated with new Test Explorer implementation, all concerns with this issue will be addressed and available when it's rolled out.