Sunday, September 09, 2007

09/09/2007 - Sunday

TV


Not Going Out and After You've Gone were excellent. I'm glad that they returned. Casualty has also returned for a new series after only being away for a few weeks. It's now on for another (roughly) 48 weeks and they're introducing some new characters as well as getting rid of some.

Healtheriser


I'm still working on the measurements tests although I think I'm nearly done with them. I need to clean up some other code as well as write a few more tests for something else (which isn't fully tested properly).

I also managed to fix a problem which had been plaguing me for a little while now. When I ran my tests using my standard way (autotest) they all completed perfectly fine, but when I ran them the standard Rails way (rake test) the integration tests would complain about accessing the fixtures data and the functional tests (controllers) gave a failure of "SQLite3::SQLException: SQL logic error or missing database".

I tried searching for anything that would help but I couldn't find anything that made the slighest difference. The changes that were suggested seemed like they weren't even taking effect. I even tried creating a new website project and adding a blank controller and test and noticed that the failure occured even then.

This had me stumped for a while until I stumbled across the cause. In tracking down why the fixtures were still being instantiated I realised that I had installed a plugin called PreloadFixtures which preloaded all of the fixture files before the tests are run in an effort to speed up the tests (they're preloaded and kept for each of the tests instead of each test loading and then destroying them). This was causing all of the fixtures to be instantiated, which is one of the problems that I was seeing. I moved the PreloadFixtures directory out of the plugins directory and ran the tests again to see if it helped in any way, and I was shocked to find that ALL of the tests now ran perfectly fine and completed!

So if anyone else has a problem with your functional tests throwing an error of "SQLite3::SQLException: SQL logic error or missing database" and you can't find any other way to fix it, please take a look in your plugins directory and see if you have the PreloadFixtures plugin and consider disabling it to see if it helps.

0 comments: