running all tests inside test/

56 views
Skip to first unread message

Josh Sharpe

unread,
Feb 27, 2014, 11:28:25 AM2/27/14
to minites...@googlegroups.com
There seems to be an exceeding amount of logic strewn about minitest to limit the test "suites" to be run to the default (old, archaic) groups that rails supposedly supports.

I'm referring to stuff like this:


paraphrased:  "run each suite separately, and only if it's in the default task group"

...but if you're a special flower and have additional test groups you can add your own test group by adding more code:


Rails has, for some time now, autoloaded everything inside the app/ directory of your project without having to modify anything out of the box.  This makes things like... app/classes, app/modules and app/fireflies legitimate directories for code.  As a corollary, test for things like that ought to belong in places like, test/classes test/modules, etc...   If rails autoloads app/, why doesn't minitest autoload test/ ?
Not to mention, things are just simpler.

Shouldn't minitest just load Dir.glob("test/**/*_test.rb") and be done with it?  

Benefits:

1) one single test run
2) doesn't reload the environment X times
3) doesn't prepare the DB X times
4) all tests get randomized (not just randomized inside groups) so you dont get order-dependent tests in your suite
5) get to delete lots of mini test code
6) more dots in a row means you get paid more dolla dolla bills
7) profit?

Thoughts?

Thanks!
Josh

Josh Sharpe

unread,
Feb 27, 2014, 11:30:50 AM2/27/14
to minites...@googlegroups.com
Let me amend that by also saying that I dont mean tasks like... minitest:unit and minitest:controllers should go away.  I think the default task should be smarter and more inclusive of test that it finds and executes.
Reply all
Reply to author
Forward
0 new messages