I have just migrated to use Rail 1.1 from 1.0. In the progress of fixing and cleaning up the unit tests. I found the following problem. I am not sure if this is a bug or it is my environment. When I run "rake test_units, some of the index in association tables is not created, this leads to failures for some unit test cases. Thinking that may be because I didn''t setup the database correctly, I reload the sql file (with the index defined) into both test and development database. run the test mannually, i.e. ruby test/units/myclass_test.rb works fine. But when I invoke rake test_units to run all unit tests in a batch, I have the same problem again. It seems db/schema.rb generated from the rake test_units has missed some of the indexes definition for some of the tables. Anyone know where I should look to locate the problem? It only occurs to some of the tables not all of them. So I think it must be something wrong with some of my code somewhere... Thanks in advance. -- Posted via http://www.ruby-forum.com/.
I had the same problem once. Just run your test_units manually. I think there''s a problem with rake test_units. I bet that your functional test run just fine with rake, isn''t it? On 6/2/06, Chester Chee <cchee@arising.net> wrote:> > I have just migrated to use Rail 1.1 from 1.0. > > In the progress of fixing and cleaning up the unit tests. I found the > following problem. I am not sure if this is a bug or it is my > environment. > > When I run "rake test_units, some of the index in association tables is > not created, this leads to failures for some unit test cases. > > Thinking that may be because I didn''t setup the database correctly, I > reload the sql file (with the index defined) into both test and > development database. > > run the test mannually, i.e. ruby test/units/myclass_test.rb works fine. > > But when I invoke rake test_units to run all unit tests in a batch, I > have the same problem again. It seems db/schema.rb generated from the > rake test_units has missed some of the indexes definition for some of > the tables. > > Anyone know where I should look to locate the problem? It only occurs to > some of the tables not all of them. So I think it must be something > wrong with some of my code somewhere... Thanks in advance. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060602/e85e42f5/attachment-0001.html
On 6/2/06, Chester Chee <cchee@arising.net> wrote:> > > In the progress of fixing and cleaning up the unit tests. I found the > following problem. I am not sure if this is a bug or it is my > environment. > > When I run "rake test_units, some of the index in association tables is > not created, this leads to failures for some unit test cases. > > Thinking that may be because I didn''t setup the database correctly, I > reload the sql file (with the index defined) into both test and > development database. > > run the test mannually, i.e. ruby test/units/myclass_test.rb works fine. >I have had a similar problem myself, recently. My project has a number of migrations. When I run rake test:units, it seems to revert to a previous migration and wipes out the latest. The schema_info bit, however, would not be updated to point at a previous generation, even though the migration appeared to be rolled back. I thought schema.rb might be to blame - does Rake recreate the test database with that? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060602/2789163e/attachment.html
Chester Chee
2006-Jun-02 20:41 UTC
[Rails] Re: Wierdness with rake test_units and schema.rb
Ioana Kanda wrote:> I had the same problem once. Just run your test_units manually. I think > there''s a problem with rake test_units. I bet that your functional test > run > just fine with rake, isn''t it?Yup, functional test runs fine. -- Posted via http://www.ruby-forum.com/.