You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Motivation
Step towards #3421
This PR adds the second part of the test add-on documentation, which is command resolution. I tried to explain in a generic way, showing some examples of what command resolution is supposed to do.
Please let me know if this is not clear enough and if the examples need to be enhanced.
Copy file name to clipboardExpand all lines: jekyll/test_framework_addons.markdown
+112-1Lines changed: 112 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ test frameworks, like [Active Support test case](rails-add-on) and [RSpec](https
16
16
There are 3 main parts for contributing support for a new framework:
17
17
18
18
-[Test discovery](#test-discovery): identifying tests within the codebase and their structure
19
-
- Command resolution: determining how to execute a specific test or group of tests
19
+
-[Command resolution](#command-resolution): determining how to execute a specific test or group of tests
20
20
- Custom reporting: displaying test execution results in the test explorer
21
21
22
22
## Test discovery
@@ -220,3 +220,114 @@ module RubyLsp
220
220
end
221
221
end
222
222
```
223
+
224
+
## Command resolution
225
+
226
+
Command resolution is the process of receiving a hierarchy of tests selected in the UI and determining the shell commands required to run them. It's important that we minimize the number of these commands, to avoid having to spawn too many Ruby processes.
227
+
228
+
For example, this is what consolidated commands could look like when trying to run two specific examples in different
229
+
frameworks:
230
+
231
+
```shell
232
+
# Rails style execution (very similar to RSpec)
233
+
bin/rails test /project/test/models/user_test.rb:10:25
You can refer to implementation examples for [Minitest and Test Unit](https://github.com/Shopify/ruby-lsp/blob/d86f4d4c567a2a3f8ae6f69caa10e21c4066e23e/lib/ruby_lsp/listeners/test_style.rb#L10) or [Rails](https://github.com/Shopify/ruby-lsp-rails/blob/cb9556d454c8bb20a1a73a99c8deb8788a520007/lib/ruby_lsp/ruby_lsp_rails/rails_test_style.rb#L11).
0 commit comments