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

Make rails test run rake test #27088

Closed
scottgonzalez opened this issue Nov 17, 2016 · 6 comments
Closed

Make rails test run rake test #27088

scottgonzalez opened this issue Nov 17, 2016 · 6 comments
Labels

Comments

@scottgonzalez
Copy link
Contributor

Steps to reproduce

Modify the test rake task and then run rails test.

Expected behavior

I expect that rails test will just run rake test.

Actual behavior

rails test only executes Minitest.run.

System configuration

Rails version: 5.0.0.1

Ruby version: 2.3.1-p112 (x86_64-darwin16)


Since the test task is already set up to run minitest, is there a reason that the test command is included in Rails::CommandsTasks::COMMAND_WHITELIST? I can send a PR to remove this from the whitelist if that's acceptable. This caused me to waste a lot of time trying to figure out why modifications to the test task didn't affect rails test.

@rafaelfranca
Copy link
Member

rails test is different from rake test by design. We want to move away from rake. rails test will not run rake test, so we need to think in another way to fix this issue. Why do you need to modify the test task?

@rafaelfranca
Copy link
Member

cc @kaspth since you have more context on this

@scottgonzalez
Copy link
Contributor Author

rails test is different from rake test by design. We want to move away from rake. rails test will not run rake test, so we need to think in another way to fix this issue.

Is there a document or blog post explaining why rails is moving away from rake? Everything not in the whitelist is a direct pass through to rake, so I don't really understand this.

Why do you need to modify the test task?

Because developers expect to run rails test to run all tests, and we need to inject additional tests into the test task. Specifically, we're adding a rubocop task as a dependency of the test task.

@rafaelfranca
Copy link
Member

#18878.

Because developers expect to run rails test to run all tests, and we need to inject additional tests into the test task. Specifically, we're adding a rubocop task as a dependency of the test task.

In Rails 5 this is not true anymore rails test does run all the tests but it doesn't run rake tasks.

All this information is present in the release notes and changelogs. Example:

http://guides.rubyonrails.org/5_0_release_notes.html#test-runner.

Right now it is not possible to extend the rails commands, so you are not able to add dependencies to the rails test command, but we are working on this for Rails 5. #26414.

@rafaelfranca
Copy link
Member

Everything not in the whitelist is a direct pass through to rake, so I don't really understand this.

This is also going to change in Rails 5.1. We are not going to pass things to rake anymore.

@kaspth
Copy link
Contributor

kaspth commented Nov 20, 2016

but we are working on this for Rails 5

We're currently targeting 5.1 for that, yeah. But don't think we need to keep this issue open for that work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants