From alexch at gmail.com Fri Mar 13 13:48:24 2009 From: alexch at gmail.com (Alex Chaffee) Date: Fri, 13 Mar 2009 10:48:24 -0700 Subject: [Rake-devel] shhh Message-ID: <7a93bd340903131048m78bf50r332a3398912e8a80@mail.gmail.com> 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". 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?) - Alex P.S. Is Jim even using this list anymore? I notice there was a release recently without an announcement on this list. --- Alex Chaffee - alex at stinky.com Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch | http://alexch.tumblr.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.weirich at gmail.com Fri Mar 13 18:01:07 2009 From: jim.weirich at gmail.com (Jim Weirich) Date: Fri, 13 Mar 2009 16:01:07 -0600 Subject: [Rake-devel] shhh In-Reply-To: <7a93bd340903131048m78bf50r332a3398912e8a80@mail.gmail.com> References: <7a93bd340903131048m78bf50r332a3398912e8a80@mail.gmail.com> Message-ID: 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 -- jim.weirich at gmail.com From alexch at gmail.com Fri Mar 13 23:22:48 2009 From: alexch at gmail.com (Alex Chaffee) Date: Fri, 13 Mar 2009 20:22:48 -0700 Subject: [Rake-devel] shhh In-Reply-To: References: <7a93bd340903131048m78bf50r332a3398912e8a80@mail.gmail.com> Message-ID: <7a93bd340903132022x2b2585f7x9370d2c051c0fb8c@mail.gmail.com> Hi, Jim! Nice to see you. Sorry for implying you were an absentee landlord :-) > 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. Oh, you're right, I got confused. Test::Unit shows stack traces just fine these days. 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. > Yeah, I see why you wanted that feature in early on, but I'd like to think people are used to that behavior by now. And if something mysterious is going wrong you'd turn on "show me everything" verbosity which would include the directory info. > 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. > When I read this I had a sinking feeling, and I checked, and guess what? It's not me... it's RAILS that's doing that. rails-2.2.2/lib/tasks/testing.rake has "t.verbose = true" all over the place. Ick. I wonder if there's a clean way to override that. I think if we changed the TestTask to inherit verbosity settings from the command line then we could patch Rails in an acceptable way. > 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. > Thanks for the goahead. I'll check into that. - A -------------- next part -------------- An HTML attachment was scrubbed... URL: