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

Add code lens for running tests #584

Closed
vinistock opened this issue Mar 28, 2023 · 2 comments
Closed

Add code lens for running tests #584

vinistock opened this issue Mar 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vinistock
Copy link
Member

vinistock commented Mar 28, 2023

Discover test examples using the code lens request and return Run entries for each one plus one for running the entire file at the class level.

We should

  • Support only Minitest / test-unit for now
  • Allow running specific examples or the entire test class
  • Use the data attribute (which allows for any information we want) to
    • Specify that the code lens is a test (e.g.: type: "test"). This will make it easier to create a test controller on VS Code
    • Specify the command that the client should use to execute that test. It'll most likely be TESTOPTS="-n='/NAME_OF_THE_TEST/'" ruby -Itest PATH_TO_TEST_FILE. Do not use rake since we want to be able to run tests even in projects that may not be using it

Note: this also involves creating a VS Code command that is used to execute the test. The first version of this should only grab whatever command was received in the data attribute and run that in the terminal.

Documentation: https://microsoft.github.io/language-server-protocol/specification#textDocument_codeLens

@matteeyah
Copy link

matteeyah commented Apr 4, 2023

This is related to https://github.com/connorshea/vscode-ruby-test-adapter

Since this conflicts with the functionality of that plugin, it'd be cool if https://github.com/Shopify/vscode-ruby-lsp could be used as a drop in replacement.

The main things that I think are missing are starting a debugging session for a test (which could lean on https://github.com/ruby/vscode-rdbg) and showing all tests in the native VS Code test explorer (#1554).

@adisonlampert
Copy link
Contributor

adisonlampert commented Apr 5, 2023

@matteeyah

The main things that I think are missing as of right is starting a debugging session for a test

This is one of our goals. We've been working on setting up ruby/debug (for example, #1542 & Shopify/vscode-ruby-lsp#539). Adding test running capability is just the first step 😃

vinistock pushed a commit that referenced this issue Feb 28, 2024
Support debugging tests with code lens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants