Smoke test against a minimal Ruby project
Background
https://github.com/Shopify/ruby-lsp/pull/698 wasn't caught because we were testing against a codebase which had already required uri.
Approach
To help prevent bugs such as https://github.com/Shopify/ruby-lsp/pull/698, we want to create a basic smoke test against a very minimal project. As a starting point this could just ensure that Ruby LSP boots successfully.
Hey @andyw8, do we have a list of basic functionalities that should be tested ?
Hi @giovannism20,
At the minimal, I think we'd want to test against having no Gemfile, and against a Rails app Gemfile.
Checking with @vinistock, he suggested the approach shown below. It's similar to what we do in test/integration_test.rb currently, but would be better isolated:
class FullIntegrationTest < Minitest::Test
def test_no_gemfile
# create tmpdir with no gemfile
# boot LSP
stdin, stdout, stderr, wait_thr = Open3.popen3("exe/ruby-lsp")
# run many requests and verify the return
# (look at `integration_test` for ideas)
verify_requests(stdin, stdout, stderr, wait_thr)
end
def test_rails_gemfile
# create gemfile similar the how a brand new rails app would look, but with ruby-lsp added
end
def test_something_else
# ...
end
end
Would it be interesting to put this in another test file @andyw8 ?
Yes, e.g. test/full_integration_test.rb
Another situation which this would have probably caught:
https://github.com/Shopify/ruby-lsp/pull/1068
Not a priority, so let's close for now.