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 new run handler for test controller #3251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Feb 26, 2025

Motivation

Closes #3177

This PR adds a new run handler for the test controller, which asks the server for the resolve commands and then executes them with streaming updates.

Important: after this PR, there are still some details to iron out and this doesn't fully work out of the box. For example, we need the Test Unit reporter to automatically do this:

ARGV << "--runner ruby_lsp"

We also may need a way for add-ons to register their reporter paths so that they are required automatically.

However, this implements the bulk of the integration, so it will be easier to deal with the other details once this is shipped.

Implementation

  1. Added the JSON RPC package as an explicit dependency. It is already a transitive dependency of the LSP package, so this is not actually adding anything, but our linters enforce the good practice of declaring explicit dependencies
  2. Added the run handler when the feature flag is enabled. It will ask the server for commands and execute them using JSON RPC to receive notifications back about the state of tests, which it then uses to update the UI

Automated Tests

The easiest way I found of testing this is to create a small fake test server script, so that we can mock the resolve commands return and still have something that will print JSON RPC notifications.

I also extract a common part of the test.

Copy link
Member Author

vinistock commented Feb 26, 2025


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock changed the base branch from 02-25-resolve_minitest_commands to graphite-base/3251 February 26, 2025 20:54
@vinistock vinistock force-pushed the graphite-base/3251 branch from 50a38f7 to 2da4c74 Compare March 7, 2025 13:31
@vinistock vinistock force-pushed the 02-26-add_new_run_handler_for_test_controller branch from 7ca5b19 to 1e3d6a1 Compare March 7, 2025 13:31
@vinistock vinistock changed the base branch from graphite-base/3251 to main March 7, 2025 13:31
@vinistock vinistock force-pushed the 02-26-add_new_run_handler_for_test_controller branch from 1e3d6a1 to 4caf625 Compare March 7, 2025 13:35
@vinistock vinistock added vscode This pull request should be included in the VS Code extension's release notes enhancement New feature or request labels Mar 7, 2025 — with Graphite App
@vinistock vinistock self-assigned this Mar 7, 2025
@vinistock vinistock marked this pull request as ready for review March 7, 2025 13:41
@vinistock vinistock requested a review from a team as a code owner March 7, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
1 participant