Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby: ["3.0", "3.1", "3.2"]
ruby: ["3.0", "3.1", "3.2", "truffleruby", "truffleruby-head"]
exclude:
- os: windows-latest
ruby: "3.3"
ruby: "truffleruby-head"
- os: windows-latest
ruby: "truffleruby"
runs-on: ${{ matrix.os }}
name: Ruby ${{ matrix.ruby }} on ${{ matrix.os }}
steps:
Expand Down
20 changes: 16 additions & 4 deletions test/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,22 @@ def teardown
make_request("shutdown")
send_request("exit")

# Make sure IOs are closed
@stdin.close
@stdout.close
@stderr.close
# Give the server some time to process the "shutdown" and "exit" messages before
# closing the streams. Otherwise, it's possible the server misses one or both of them
# depending on what it's currently processing. This is wrapped in a timeout in case
# the server fails to process the messages.
begin
Timeout.timeout(60) do
sleep(0.010) while @wait_thr.alive?
end
rescue Timeout::Error
raise "The LSP server failed to shut down cleanly."
ensure
# Make sure IOs are closed
@stdin.close
@stdout.close
@stderr.close
end

# Make sure the exit status is zero
assert_equal(0, @wait_thr.value)
Expand Down
8 changes: 5 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
require "minitest/autorun"
require "minitest/reporters"
require "tempfile"
require "debug"
require "mocha/minitest"

sorbet_paths = Gem.loaded_specs["sorbet-runtime"].full_require_paths.freeze
DEBUGGER__::CONFIG[:skip_path] = Array(DEBUGGER__::CONFIG[:skip_path]) + sorbet_paths
unless RUBY_ENGINE == "truffleruby" || RUBY_PLATFORM =~ /mingw|mswin/
require "debug"
sorbet_paths = Gem.loaded_specs["sorbet-runtime"].full_require_paths.freeze
DEBUGGER__::CONFIG[:skip_path] = Array(DEBUGGER__::CONFIG[:skip_path]) + sorbet_paths
end

minitest_reporter = if ENV["SPEC_REPORTER"]
Minitest::Reporters::SpecReporter.new(color: true)
Expand Down
Loading