-
Notifications
You must be signed in to change notification settings - Fork 203
Write TCP server port to a tempfile instead of using env var #3452
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
Write TCP server port to a tempfile instead of using env var #3452
Conversation
How to use the Graphite Merge QueueAdd 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. |
17aabe4
to
fb817c8
Compare
fb817c8
to
5fac84e
Compare
5fac84e
to
45dae57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions, but LGTM overall
Co-authored-by: Alexander Momchilov <amomchilov@users.noreply.github.com>
* WIP * Implement RSpec command resolution * Support streaming RSpec results * Generate ids purely based on locations This makes sure that we can always match the ids even for anonymous examples. * Add tests for the rspec formatter * Don't fail fast on CI * Allow RSpecFormatter to not have typed: strict * Requires ruby-lsp 0.23.17 For Shopify/ruby-lsp#3452
Motivation
The strategy of passing the port to LSP reporter via environment variable is a bit weak. For example, if you reload VS Code and then proceed to run tests manually in a terminal that we set up, you will get a connection refused error because we never updated the port variable in that old terminal.
I think we can be a lot more reliable by writing the port to a file.
Implementation
Every workspace reports test results through the same port, so my idea is to write a temporary file with the port information that the LSP reporter can read on its own.
That way, every time the extension reloads, we update the port in the file and, every time the tests are executed (regardless if it's manual or through the explorer), we will read that value again ensuring that we're using the right port.
Finally, I noticed one more hurdle. When running tests manually through the terminal, we were receiving the connection okay, but there was no
run
object to use for reporting the items' statuses. We need to create arun
object on demand when not running through the explorer, otherwise the statuses won't appear as expected.