Files
2012-02-21 01:15:00 -05:00

1 line
6.3 KiB
JSON

[{"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728461.9276421, "message": "yup, exactly. we only teardown our test db when we have schema changes. otherwise we can run tests infinitely without any table/index creation.", "group_id": 81, "id": 310634}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728489.942477, "message": "otherwise you just run nosetests and we can all do that against the same db at the same time and inspect test data after test runs etc.", "group_id": 81, "id": 310645}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728849.671277, "message": "I considered it a necessary evil, but that may be a blocker for you.", "group_id": 81, "id": 310716}, {"user_id": 3965, "stars": [], "topic_id": 11894, "date_created": 1299727382.6535029, "message": "I've got a site/project that has a lot of INSTALLED_APPS and a dependency on postgis (so running a SQLite :memory: instance is out).", "group_id": 81, "id": 310477}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728706.7337379, "message": "next step is to get some mock objects to replace request, response and the models so we can properly unit test our handlers. What we have now are more like functional tests as they go through the full django stack.", "group_id": 81, "id": 310677}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728915.651438, "message": "I think it took less than a day to create the framework. it took 3 days to port our tests.", "group_id": 81, "id": 310728}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728167.454042, "message": "We ran into the same problem. We ended up ditching Django's built in test runner/framework and using Nose + WebTest. Instead of using static fixtures which are reloaded after every test, every test generates its own unique data.", "group_id": 81, "id": 310577}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728646.16328, "message": "For us the key was reducing the amount of time in setup/teardown and most of that was schema related and reloading the fixtures. since we eliminated both of those while running the test suite and took it out of band our tests run a lot faster (although still not as fast as I'd like for TDD)", "group_id": 81, "id": 310665}, {"user_id": 3965, "stars": [], "topic_id": 11894, "date_created": 1299727464.8176301, "message": "...and running even a subset of the test suite is painful because of the test db creation at the beginning of every test run. Any one in a similar situation have any tips on how to get the suite to run faster (so you can stay in the code / test / run / code cycle with less waiting)?", "group_id": 81, "id": 310498}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728236.6196859, "message": "unfortunately the code we have is very specific to our Django app so I can't share any code.", "group_id": 81, "id": 310588}, {"user_id": 3965, "stars": [], "topic_id": 11894, "date_created": 1299728353.339082, "message": "Cool, I'll have to investigate Nose + WebTest. I'm also thinking about a custom runner that truncates and migrates an always-existant unit test db ala: http://stackoverflow.com/questions/3799061/speeding-up-django-testing", "group_id": 81, "id": 310617}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728197.449656, "message": "we also took database setup/teardown outside of the test runner as every test that is run is idempotent and requires no data from previous tests etc.", "group_id": 81, "id": 310580}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728316.2427599, "message": "The bonus of this approach is that we can distribute our test suite when we want to go with CI, whereas with Django's built in test runner it seems like you'd have to have a separate database for each test in order to run small parts of the test suite concurrently on multiple machines.", "group_id": 81, "id": 310609}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728829.633039, "message": "it's just the porting of tests to nose and the webtest client that takes the time.", "group_id": 81, "id": 310710}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299729036.5187991, "message": "others might have better ideas than replacing django's built in stuff. I've never liked the django test runner so I jumped at the chance to replace it :)", "group_id": 81, "id": 310751}, {"user_id": 3965, "stars": [], "topic_id": 11894, "date_created": 1299728757.168201, "message": "Yeah I think if we can eliminate schema setup on every suite run that'll help a ton, then we can go about optimizing our use of fixtures = [] and such to reduce cycle time per test. But for now it's cycle time per suite that's just murdering me.", "group_id": 81, "id": 310689}, {"user_id": 1873, "stars": [], "topic_id": 11894, "date_created": 1299728814.8256071, "message": "you should be able to get that fairly quickly.", "group_id": 81, "id": 310703}, {"user_id": 3965, "stars": [], "topic_id": 11894, "date_created": 1299728933.861109, "message": "Yeah, we've got some pretty tight deadlines so the test porting might have to wait till post-launch.", "group_id": 81, "id": 310733}, {"user_id": 927, "stars": [{"date_created": 1299772802.9871681, "user_id": 14679}], "topic_id": 11894, "date_created": 1299758981.4953661, "message": "Disabling fsync for Postgres is also a cheap win as might be storing data on a ramdisk", "group_id": 81, "id": 312771}, {"user_id": 927, "stars": [], "topic_id": 11894, "date_created": 1299758763.1665289, "message": "I monkey-patched the Django test runner to avoid reloading fixtures on every test - with our data simply using transactions rather than reloading complex fixtures shaved 2/3s of runtime", "group_id": 81, "id": 312751}, {"user_id": 927, "stars": [], "topic_id": 11894, "date_created": 1299758925.106534, "message": "Basically you depend on doing the right thing with transactions but it's easy to have Hudson run the exhaustive suite nightly just in case", "group_id": 81, "id": 312763}, {"user_id": 927, "stars": [], "topic_id": 11894, "date_created": 1299758837.8568809, "message": "The other hack was switching from the JSON loader to SQL, which saved more time than I'd expected.", "group_id": 81, "id": 312757}]