This site is an archive; learn more about 8 years of OpenHatch.

[OH-Dev] [issue889] MySQL-based test suite fails due to problems with fixture loading

John Morrissey bugs at openhatch.org
Thu Oct 17 00:48:57 UTC 2013


New submission from John Morrissey <jwm at horde.net>:

20:33:22< johnmorr> paulproteus: do you have any idea why the travis build would fail (and
 in nonsensical ways) with USE_MYSQL == true?
20:33:38< paulproteus> Sadly yes.
20:33:47 * johnmorr listens to paulproteus.
20:33:54< paulproteus> They mostly relate to some kind of insanity in the inter-dependenci
es between the fixtures and their primary keys.
20:34:07< paulproteus> That's the first one.
20:34:17< paulproteus> You can see some of this with sqlite too, but we skip those tests w
ith sqlite.
20:34:48< paulproteus> Let me go read the log for the rest
20:34:59< johnmorr> https://travis-ci.org/openhatch/oh-mainline/jobs/12337407
20:35:31< johnmorr> looks like a bunch of twill failures, too
20:35:32< paulproteus> https://travis-ci.org/openhatch/oh-mainline/jobs/12337093 is simply
 because someone needs to 'apt-get install python-mysqldb'
20:35:33< paulproteus> let me read that
20:35:46< paulproteus> The twill failures are usually because the app lacks the data that 
the tests expect, fwiw.
20:35:52< paulproteus> Which are because the fixture loads failed.
20:36:10< paulproteus> iirc we hit this problem with mysql 5.5 and up, but not e.g. 5.0, o
n which we developed ~4y ago
20:36:31< johnmorr> this problem == the fixture loads failing?
20:36:35< paulproteus> Yeah.
20:36:50< paulproteus> Which you should be able to reproduce by doing:
20:36:53< paulproteus> $ export USE_MYSQL=1
20:37:01< paulproteus> $ python manage.py syncdb --noinput
20:37:11< paulproteus> $ python manage.py loaddata just_one_person.json
20:37:26< paulproteus> (where just_one_person.json is the file part of a path of a real file in 
mysite/*/fixtures/* )
20:37:38< paulproteus> (I'm not sure that's a real valid name, but it's a made-up example; I hope 
that's clear enough)
20:37:43< johnmorr> nod paulproteus 
20:38:04< paulproteus> So if you look at the failing tests, and the values of the fixtures list for 
that test, you should probably be able to trigger the insane errors by simply loading them in the 
order they are provided to that test case.
20:38:08< paulproteus> Now... what to do about that.
20:38:33< paulproteus> The lovely Walter iirc at PyCon sprints 2012 (2011??) looked into this for 
a while and came out of it with his head spinning.
20:38:40< paulproteus> Probably we can combine more of the fixtures into one file.
20:38:52< paulproteus> Part of the problem (most of it? all of it?) relates to auto-creating Person 
objects from User objects.
20:38:59< paulproteus> it's all coming back to me...
20:39:06< paulproteus> There's a post-create hook for the User object which makes sure a 
Person object gets made.
20:39:24< paulproteus> But in fixture load time we definitely want not to auto-create the Person 
-- we want to use the Person object that is provided in the JSON!
20:39:28< paulproteus> That's what I recall.
20:39:43< paulproteus> I think that's the whole story. It's relatively bad, but also relatively hairy.
20:39:47< paulproteus> If it could end, that would be fantastic.

----------
assignedto: jwm
messages: 3897
nosy: jwm, paulproteus
priority: bug
status: in-progress
title: MySQL-based test suite fails due to problems with fixture loading

__________________________________________
Roundup issue tracker <bugs at openhatch.org>
<https://openhatch.org/bugs/issue889>
__________________________________________


More information about the Devel mailing list