On Mar 13, 2009, at 11:48 AM, Alex Chaffee wrote:
Rake is too loud.
It's also too quiet when it should be louder, forcing me to run it
again
with --trace, which makes it *way* too loud.
Please let me explain.
Here's what a successful test run looks like for my current project:
Pepper:moodlog chaffee$ rake
(in /Users/chaffee/dev/moodlog)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-I"/Users/chaffee/dev/moodlog/lib" -I"/Users/chaffee/dev/moodlog/test"
"/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb"
"test/unit/address_test.rb" "test/unit/address_widget_test.rb"
"test/unit/color_test.rb" "test/unit/feeler_test.rb"
"test/unit/line_test.rb" "test/unit/mailman_test.rb"
"test/unit/moment_test.rb" "test/unit/mood_test.rb"
"test/unit/person_mailer_test.rb" "test/unit/person_test.rb"
"test/unit/schedule_feeler_test.rb" "test/unit/schedule_test.rb"
"test/unit/urlencode_test.rb"
Loaded suite
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
....................................................................................................................................................
Finished in 2.343631 seconds.
148 tests, 2416 assertions, 0 failures, 0 errors
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-I"/Users/chaffee/dev/moodlog/lib" -I"/Users/chaffee/dev/moodlog/test"
"/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb"
"test/functional/addresses_controller_test.rb"
"test/functional/colors_controller_test.rb"
"test/functional/feelers_controller_test.rb"
"test/functional/home_controller_test.rb"
"test/functional/moments_controller_test.rb"
"test/functional/moods_controller_test.rb"
"test/functional/people_controller_test.rb"
"test/functional/schedules_controller_test.rb"
"test/functional/sessions_controller_test.rb"
Loaded suite
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader
Started
..........................................................................................
Finished in 1.911496 seconds.
90 tests, 221 assertions, 0 failures, 0 errors
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-I"/Users/chaffee/dev/moodlog/lib" -I"/Users/chaffee/dev/moodlog/test"
"/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake/rake_test_loader.rb"
And here's what I'd like it to look like:
Pepper:moodlog chaffee$ rake
Running unit tests.
Started
....................................................................................................................................................
Finished in 2.343631 seconds.
148 tests, 2416 assertions, 0 failures, 0 errors
Running functional tests.
Started
..........................................................................................
Finished in 1.911496 seconds.
90 tests, 221 assertions, 0 failures, 0 errors
See what I mean?
Also, when there's a test failure, I'd like to see it and its stack
trace
immediately, without having to rerun with "--trace".
The printout of the stack trace for a broken test is done by
Test::Unit, not Rake. Using trace to debug a broken test is generally
unhelpful (i.e. it just points you to the code that runs the test
suite).
As I see it, rake has kind of mixed up the expected meanings of the
--quiet,
--silent, --verbose and --trace flags, and the Rake Test task mixes
them up
even further, and outputs a bunch of stuff we rarely if ever care
about
while suppressing stuff we always care about.
I'd be happy to take a crack at a proposal and a solution in code,
but I'd
like to get an opinion from this group (and hopefully Jim Weirich)
first.
The most important thing, in my opinion, is to disentangle the two
meanings
of "--trace", since my preference is to be able to show backtraces
but *not*
show task traces. Next up would be to take out the current directory
and
full list of test.rb targets except in case of emergency verbosity.
(Really,
are they ever useful except when debugging your rakefile or rake
itself?)e
The Rake code runs in a (possibly) different current directory than
the directory where the rake command itself was invoked. At the time,
I felt that was unusual enough to make it clear where rake decided to
run. Maybe this is no longer true.
Regarding the full list of tests, set the verbose flag in the test
task definition. This should be defaulting to false, so you must be
explicitly setting it to true.
Regarding the "Loading Suite ..." message, this is printed by
Test::Unit, but it looks like it can be controlled via an output
level. I'm not quite sure how to influence its setting, but I suspect
it can be done. I would certainly entertain a patch to allow this to
be controlled from the testtask definition.
P.S. Is Jim even using this list anymore? I notice there was a release
recently without an announcement on this list.
--
-- Jim Weirich
-- [email protected]
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel