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

Investigate how to properly handle in-app engine's tests

Open st0012 opened this issue 2 years ago • 1 comments

Assume an user has a Rails app called my_app, which has in-app engines with the following file structure:

my_app
├── app
├── config
├── (other Rails app folders)
└── engines
    └── my_engine
        └── test/my_test.rb

Todos

  • [ ] Check what's the official/best practice of running an in-app engine's unit tests

  • [ ] When opening my_test.rb from the my_app workspace, the code lens should generate such command:

    bundle exec bin/rails test engines/my_engine/test/my_test.rb
    

    We need to check if this are expected to work or not.

    • If the answer is no, it means tests are expected to be executed under the my_engine directory.
  • [ ] Is there any other common in-app Rails engine setup we should consider

st0012 avatar Jan 04 '24 19:01 st0012

Can you explain why the current mechanism doesn't work?

We use the absolute path for running tests instead of relative exactly to try to avoid issues with nested projects, so I'm not sure what the problem is.

vinistock avatar Jan 05 '24 13:01 vinistock