Hi, I''m relatively new to Ruby and Rails. We are using it at work and running in a TDD/continuous integration environment. I am getting some functional tests failing. We have a UserController and have the basic REST endpoints for the controller. The functional test makes use of a user fixture to test the delete, update and edit calls. the edit and update test methods fail. And it is because they are using the same fixture that the delete is. Since the delete test method gets run first it''s deleting the user the edit and update are depending on. (if i use a different fixture for each test they all pass) However it''s my understanding that the tests are supposed to be isolated from each other and the test should pass using the same fixture for each. This belief is further backed up by the fact that it the tests pass on our CI machine. So my first guess is that it must be something on my machine (I''m running on a Mac OS X mac book pro). But I''m not sure where to start looking ... I''ve resynched to the source tree from my source control. So I know I have the exact code that the source repository has. so I''m wondering if anyone has any suggestions as to where to start tracking this down? What types of things you would try... etc Thanks so much! Jay --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 29 Feb 2008, at 17:13, Jay wrote:> > This belief is further backed up by the fact that it the tests pass on > our CI machine. > > So my first guess is that it must be something on my machine (I''m > running on a Mac OS X mac book pro). But I''m not sure where to start > looking ... > I''ve resynched to the source tree from my source control. So I know I > have the exact code that the source repository has. >Tests are run inside a transaction, so anything that breaks transactions will break your tests (since changes won''t be rolled back). Could it be that (assuming you''re using mysql) that your CI machine is defaulting to InnoDB tables and your laptop is defaulting to MyISAM (or doesn''t have innodb compiled in) ? Fred> so I''m wondering if anyone has any suggestions as to where to start > tracking this down? What types of things you would try... etc > > Thanks so much! > Jay > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jay: How are you running the tests on your Mac? Manually? Or are you using the rake task to do it? On Fri, Feb 29, 2008 at 11:13 AM, Jay <hooligan495-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I''m relatively new to Ruby and Rails. We are using it at work and > running in a TDD/continuous integration environment. > > I am getting some functional tests failing. > > We have a UserController and have the basic REST endpoints for the > controller. > > The functional test makes use of a user fixture to test the delete, > update and edit calls. > > the edit and update test methods fail. And it is because they are > using the same fixture that the delete is. Since the delete test > method gets run first it''s deleting the user the edit and update are > depending on. (if i use a different fixture for each test they all > pass) > However it''s my understanding that the tests are supposed to be > isolated from each other and the test should pass using the same > fixture for each. > > This belief is further backed up by the fact that it the tests pass on > our CI machine. > > So my first guess is that it must be something on my machine (I''m > running on a Mac OS X mac book pro). But I''m not sure where to start > looking ... > I''ve resynched to the source tree from my source control. So I know I > have the exact code that the source repository has. > > so I''m wondering if anyone has any suggestions as to where to start > tracking this down? What types of things you would try... etc > > Thanks so much! > Jay > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brian, I get the same results running both manually and via rake. Fred, Good point. I''ll went and double checked and you were spot on. Apparently my mysql db was not setting the default table type to innodb when I started it. I rectified that and all is good! Thanks so much! Jay On Feb 29, 12:29 pm, "Brian Hogan" <bpho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Jay: > > How are you running the tests on your Mac? Manually? Or are you using the > rake task to do it? > > On Fri, Feb 29, 2008 at 11:13 AM, Jay <hooligan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > > I''m relatively new to Ruby and Rails. We are using it at work and > > running in a TDD/continuous integration environment. > > > I am getting some functional tests failing. > > > We have a UserController and have the basic REST endpoints for the > > controller. > > > The functional test makes use of a user fixture to test the delete, > > update and edit calls. > > > the edit and update test methods fail. And it is because they are > > using the same fixture that the delete is. Since the delete test > > method gets run first it''s deleting the user the edit and update are > > depending on. (if i use a different fixture for each test they all > > pass) > > However it''s my understanding that the tests are supposed to be > > isolated from each other and the test should pass using the same > > fixture for each. > > > This belief is further backed up by the fact that it the tests pass on > > our CI machine. > > > So my first guess is that it must be something on my machine (I''m > > running on a Mac OS X mac book pro). But I''m not sure where to start > > looking ... > > I''ve resynched to the source tree from my source control. So I know I > > have the exact code that the source repository has. > > > so I''m wondering if anyone has any suggestions as to where to start > > tracking this down? What types of things you would try... etc > > > Thanks so much! > > Jay--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---