gma / tconsole

Testing console for Rails. Helps out with test performance and also makes it easier to run specific tests
177 stars 18 forks source link

Pass a single command as command line arguments #40

Closed nalanj closed 12 years ago

nalanj commented 12 years ago

Can do things like:

tconsole all to run all tests or tconsole UserTest to run UserTest. App runs that one command and then exits.

batasrki commented 12 years ago

I don't know about this. It's getting into the 'copy features from rspec/unit_test' territory. I thought that the entire point of tconsole is the preloaded environment. Are we planning on preloading the environment on the first "run" and re-use it for subsequent runs?

nalanj commented 12 years ago

It's mainly because running all tests this way saves me about 30-45 seconds off of using the Rails rake tasks, just because it doesn't reload the environment 4 times for the run - it just loads once and runs everything.

itstommymorgan commented 12 years ago

:+1: Make it so.

batasrki commented 12 years ago

@commondream so I was right in assuming that the env only gets loaded the first time? That's a first for me, :p

nalanj commented 12 years ago

@batasrki Well, it'd get loaded each time you run the command, but I think tconsole's beyond just being an environment preloaded at this point. You also get the benefit of pretty formatting and it the performance benefit of merging all of your tests together when running all, rather than running 3 separate rake tasks like Rails does.

itstommymorgan commented 12 years ago

Actually, in thinking about it... can't we just leave tconsole open after the specified test run completes? Or is there a use-case for closing it that I'm not thinking of?

itstommymorgan commented 12 years ago

ACTUALLY ACTUALLY: I think I would vote for both. Here's why:

Run a test and stop (I'd suggest this not be the default, but be something like tconsole --onerun UserTest): this could be really useful for integration with other tools, like perhaps a vim plugin that lets you run tests on the current file.

Run a test and stay open (I'd suggest this be the default, tconsole all): this I think makes more sense from a manual interaction standpoint; if I run all the tests and something fails I'll need to run the tests again, and it'd be much easier to do that if tconsole still has everything loaded up and ready to go.

Make sense?

nalanj commented 12 years ago

Makes sense - I think I agree with @duwanis on this, except that I'd probably call the argument --once instead of --onerun, but that's just me.

itstommymorgan commented 12 years ago

Oh you could call it --godieinafire for all I care, as long as the functionality is there. :smile:

nalanj commented 12 years ago

And, done!