ruby-lsp icon indicating copy to clipboard operation
ruby-lsp copied to clipboard

Possible regression with Code Lens for running spec-style tests

Open andyw8 opened this issue 1 year ago • 4 comments

There seems to have been some regression with the Code Lens for running spec-style tests. On Tapioca, Kaan says it was working previously, but now it is failing, e.g.

tapioca main % bundle exec ruby -Itest /Users/andyw8/src/github.com/Shopify/tapioca/spec/tapioca/cli/annotations_spec.rb --name "/^T
apioca::AnnotationsTest(#|::)/"
/opt/rubies/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- spec_helper (LoadError)
        from /opt/rubies/3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/andyw8/src/github.com/Shopify/tapioca/spec/tapioca/cli/annotations_spec.rb:4:in `<main>'

(this could relate to a change within Tapioca itself)

andyw8 avatar Oct 08 '24 15:10 andyw8

The problem is with the -Itest part. For that project, it should be -Ispec.

paracycle avatar Oct 08 '24 16:10 paracycle

If that's the only problem, then this is a duplicate of #2308 and we can close this one.

vinistock avatar Oct 08 '24 16:10 vinistock

I think https://github.com/Shopify/ruby-lsp/pull/2522 is partly the cause. If I try the ruby-lsp version prior to that (v0.17.17), and just change -Itest to -Ispec then it works, e.g.

bundle exec ruby -Ispec /Users/andyw8/src/github.com/Shopify/tapioca/spec/tapioca/cli/gem_spec.rb --name /must\ remove\ outdated\ RBIs/
Started with run options --name "/must remove outdated RBIs/" --seed 41260

andyw8 avatar Oct 08 '24 17:10 andyw8

This is likely related to the specs in Tapioca being within a class definition, which is a bit different from normal specs.

andyw8 avatar Oct 08 '24 18:10 andyw8

This issue is being marked as stale because there was no activity in the last 2 months

github-actions[bot] avatar Dec 08 '24 12:12 github-actions[bot]

I'll close this since it wasn't a regression, it had never worked previously. But it should all be working once https://github.com/Shopify/ruby-lsp/pull/2706 is released.

andyw8 avatar Dec 09 '24 17:12 andyw8