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

Ensure URI.from_path is available to minitest runner #3289

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Mar 10, 2025

When starting to verify this with Rails, I discovered the we need to ensure URI.from_path is available (it's already there for test-unit), since we use it in uri_from_test_class.

@andyw8 andyw8 requested a review from a team as a code owner March 10, 2025 20:55
@andyw8 andyw8 added the chore Chore task label Mar 10, 2025
Copy link
Contributor

@Morriar Morriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up with the Rubocop tests?

@andyw8
Copy link
Contributor Author

andyw8 commented Mar 11, 2025

RuboCop is fine, but something is failing for Ruby 3.1. Looking into.

@andyw8 andyw8 force-pushed the andyw8/uri-from-path-minitest-runner branch from cffe079 to 0c340bf Compare March 11, 2025 19:49
@andyw8 andyw8 force-pushed the andyw8/uri-from-path-minitest-runner branch from 0c340bf to fd840a6 Compare March 11, 2025 19:50
@andyw8
Copy link
Contributor Author

andyw8 commented Mar 11, 2025

I modified the test to show the underlying failure:

Failure:
RubyLsp::MinitestTestRunnerTest#test_minitest_output [/home/runner/work/ruby-lsp/ruby-lsp/test/minitest_test_runner_test.rb:19]
Minitest::Assertion: command failed: <internal:/opt/hostedtoolcache/Ruby/3.1.6/x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- ruby_indexer/lib/ruby_indexer/uri (LoadError)
	from <internal:/opt/hostedtoolcache/Ruby/3.1.6/x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from /home/runner/work/ruby-lsp/ruby-lsp/lib/ruby_lsp/ruby_lsp_reporter_plugin.rb:5:in `<top (required)>'
	from <internal:/opt/hostedtoolcache/Ruby/3.1.6/x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from <internal:/opt/hostedtoolcache/Ruby/3.1.6/x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'

It seems there is some issue with the load path. Since it only affects a Ruby version which is EOL in 2 weeks, and is only in our test code, I'm not to spend much time on this. The latest commit works around it by requiring bundler explicitly.

@andyw8 andyw8 force-pushed the andyw8/uri-from-path-minitest-runner branch from db9fbd2 to 16d58ec Compare March 11, 2025 20:14
@andyw8 andyw8 force-pushed the andyw8/uri-from-path-minitest-runner branch from 16d58ec to 6c93215 Compare March 11, 2025 20:25
@andyw8 andyw8 enabled auto-merge (squash) March 11, 2025 20:27
@andyw8 andyw8 merged commit 42e6611 into main Mar 11, 2025
42 checks passed
@andyw8 andyw8 deleted the andyw8/uri-from-path-minitest-runner branch March 11, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants