Skip to content

Use a TCP server to listen to streaming test events #3388

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

Open
wants to merge 2 commits into
base: graphite-base/3388
Choose a base branch
from

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Apr 10, 2025

Motivation

Closes #3359

This PR starts using a TCP server to listen to test events on the extension side. The logic was getting quite complicated, so I made an attempt to extract a StreamingRunner class, which I really hope made the code a bit easier to follow for others.

Implementation

In terms of behaviour changes, there isn't much. We use net.server to start a TCP server and then we pass the port as an environment variable, so that the server side integration can connect.

The rest was just moving stuff into the StreamingRunner class, so that the implementation is a bit more organized.

EDIT

I pushed a second commit that makes the TCP server persistent.

This allows us to do some interesting magic for the run in terminal profile. Since the TCP server is always on and we can control the initial terminal creation, even if the user runs tests manually inside the terminal we are still able to update the explorer statuses.

I would really like to hear people's opinion about the organization of the code afterwards.

Automated Tests

Updated our existing tests.

Copy link
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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 requested review from alexcrocha and st0012 April 10, 2025 12:03
@vinistock vinistock self-assigned this Apr 10, 2025
@vinistock vinistock added vscode This pull request should be included in the VS Code extension's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Apr 10, 2025 — with Graphite App
@vinistock vinistock marked this pull request as ready for review April 10, 2025 12:05
@vinistock vinistock requested a review from a team as a code owner April 10, 2025 12:05
@vinistock vinistock force-pushed the 04-08-use_a_tcp_socket_to_stream_test_results branch from 4624b86 to 5ddc813 Compare April 10, 2025 12:06
@vinistock vinistock force-pushed the 04-09-use_a_tcp_server_to_listen_to_streaming_test_events branch 3 times, most recently from b9853dd to fa4d84d Compare April 10, 2025 12:31
@vinistock vinistock force-pushed the 04-08-use_a_tcp_socket_to_stream_test_results branch from 5ddc813 to 377a675 Compare April 10, 2025 12:31
@vinistock vinistock force-pushed the 04-09-use_a_tcp_server_to_listen_to_streaming_test_events branch from f289ddb to f9d9b4a Compare April 10, 2025 16:12
@vinistock vinistock force-pushed the 04-08-use_a_tcp_socket_to_stream_test_results branch from 377a675 to 11b16fb Compare April 10, 2025 16:15
@vinistock vinistock force-pushed the 04-09-use_a_tcp_server_to_listen_to_streaming_test_events branch from f9d9b4a to e92b42e Compare April 10, 2025 16:15
@vinistock vinistock changed the base branch from 04-08-use_a_tcp_socket_to_stream_test_results to graphite-base/3388 April 15, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant