Forum: Ruby on Rails Why does development.log get message from testing?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rob B. (Guest)
on 2007-01-24 02:17
(Received via mailing list)
Does anyone else find it a bit annoying that the development.log gets
the output from running tests that prepares the database?  I was
hoping that this would be addressed in Rails 1.2, but it still happens.

I know the bulk of the logger output goes into test.log, but every so
often I see things like:

   SQL (0.028947)   DROP DATABASE IF EXISTS `project_test`
   SQL (0.000711)   CREATE DATABASE `project_test`
   SQL (0.019973)   SET foreign_key_checks = 0
   SQL (0.002973)   CREATE TABLE `products` (
`id` int(11) NOT NULL auto_increment,
...

in my development.log and have a second of panic that development
data is gone ("DROP DATABASE" sticks out like crazy!).

I have a feeling that the fix would be somewhere around rails-1.2.1/
lib/tasks/databases.rake line 37 for db:structure:dump, but I'd
really like to understand where RAILS_ENV is set when you just run
`rake` to perform tests.

All the messages get logged to test.log if you run `env
RAILS_ENV=test rake` rather than just `rake`.

Is it just a matter of forcing RAILS_ENV=test earlier in the
initialization process somewhere?

-Rob

Rob B.    http://agileconsultingllc.com
removed_email_address@domain.invalid
This topic is locked and can not be replied to.