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

differing number of tests #70

Closed
silent-e opened this issue Nov 23, 2017 · 4 comments
Closed

differing number of tests #70

silent-e opened this issue Nov 23, 2017 · 4 comments

Comments

@silent-e
Copy link

I've just encountered an interesting issue. I have a suite of Minitest tests. When running bundle exec m and running bundle exec m -r test I am seeing a different number of tests being run. The difference appears to be the number of tests that aren't in the standard set of test folders.

I have a test/services folder where those tests aren't running during the bundle exec m run but are in the recursive call. Also, The tests are running when I specifically run bundle exec m test/services/[test file name] so I know the m gem is picking them up at some point.

Thoughts?

(e)

PS: be in my screenshots is just my alias for bundle exec

screen shot 2017-11-23 at 4 56 43 pm

screen shot 2017-11-23 at 4 56 55 pm

@zamith
Copy link
Collaborator

zamith commented Dec 14, 2017

That is odd and should not be the expected behaviour. I'll look into it. Thanks.

@silent-e
Copy link
Author

followup… In parser.rb you are calling rake test if no argv is passed in. According to what I've read rake test does not attempt to run tests outside the standard set. But rake test:all does.

Perhaps changing to calling out to rake test:all is the better solution.

Just a thought.

(e)

@mhw
Copy link

mhw commented Jan 8, 2019

Is this on a Rails project? If so, you need to add a new task to rake so the test:run task knows to include the contents of your services directory (or any other directory you've added). Create a file called lib/tasks/test-services.rake containing something like this:

require 'rake/testtask'
require 'rails/test_unit/sub_test_task'

namespace :test do
  task run: 'test:services'

  Rails::TestTask.new(services: "test:prepare") do |t|
    t.pattern = 'test/services/**/*_test.rb'
  end
end

(From a Rails 4.1 project; newer versions might be a little different.)

@zamith
Copy link
Collaborator

zamith commented May 27, 2019

There is a proposed solution, if it does not work please reopen the issue.

@zamith zamith closed this as completed May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants