Open rohit-nsit08 opened 12 years ago
It's only taking you 15 seconds? It takes me 90 seconds to run zero tests with REUSE_DB=1
over here!
The culprit is the code that resets sequences; once I commented that out, the tests (with REUSE_DB=1
) started immediately. Since I never write tests that depend on the values of implicitly auto-incremented fields, I feel the sequence resets obviate much of the advantage of RESET_DB=1
.
On TravisCI, the MySQL tests run about the same speed as the PostgreSQL tests, and it seems faster than 15 seconds. Is this better in django-nose 1.4 for you?
I'm using mysql version 5.5 on os-X and using django-nose with REUSE_DB =1 and number of tests is 0 but still running
python manage.py test
takes roughly 15 seconds to run .
looking at mysql logs shows that the culprit is ALTER TABLE query
my logs :
121024 10:16:53 65 Connect rohitjangid@localhost as on 65 Quit
66 Connect root@localhost on test_navibank2 66 Query SET NAMES utf8 66 Query set autocommit=0 121024 10:16:54 66 Query SHOW TABLES 66 Query ALTER TABLE
auth_permission
AUTO_INCREMENT = 1 121024 10:16:55 67 Connect rohitjangid@localhost as on 67 Quit66 Query ALTER TABLE
auth_group
AUTO_INCREMENT = 1 121024 10:16:56 66 Query ALTER TABLEauth_user
AUTO_INCREMENT = 1 66 Query ALTER TABLEauth_message
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjango_content_type
AUTO_INCREMENT = 1 121024 10:16:57 68 Connect rohitjangid@localhost as on 68 Quit66 Query ALTER TABLE
django_site
AUTO_INCREMENT = 1 66 Query ALTER TABLEbankaccount_user_profile
AUTO_INCREMENT = 1 66 Query ALTER TABLEbankaccount_hospital
AUTO_INCREMENT = 1 66 Query ALTER TABLEbankaccount_copprofile
AUTO_INCREMENT = 1 66 Query ALTER TABLEbankaccount_wealth_history
AUTO_INCREMENT = 1 121024 10:16:58 66 Query ALTER TABLEbankaccount_biometrichistory
AUTO_INCREMENT = 1 66 Query ALTER TABLEbankaccount_cop_patient
AUTO_INCREMENT = 1 121024 10:16:59 66 Query ALTER TABLEbankaccount_friends
AUTO_INCREMENT = 1 69 Connect rohitjangid@localhost as on 69 Quit66 Query ALTER TABLE
bankaccount_policeslog
AUTO_INCREMENT = 1 66 Query ALTER TABLEbusiness_businessdb
AUTO_INCREMENT = 1 66 Query ALTER TABLEbusiness_businesslog
AUTO_INCREMENT = 1 121024 10:17:00 66 Query ALTER TABLEdummy_dummygroups
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_dummys
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_dummynames
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_dummymeasuretowealthmaps
AUTO_INCREMENT = 1 121024 10:17:01 66 Query ALTER TABLEdummy_dummyingredientmappings
AUTO_INCREMENT = 1 70 Connect rohitjangid@localhost as on 70 Quit66 Query ALTER TABLE
dummy_dummylogs
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_bankvalet
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_clutter
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_userdummys
AUTO_INCREMENT = 1 121024 10:17:02 66 Query ALTER TABLEdummy_userdummyingredientmappings
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_userdummymeasuretowealthmaps
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_advice
AUTO_INCREMENT = 1 66 Query ALTER TABLEdummy_iflmylogs
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjango_admin_log
AUTO_INCREMENT = 1 121024 10:17:03 71 Connect rohitjangid@localhost as on 71 Quit66 Query ALTER TABLE
feedback_feedback
AUTO_INCREMENT = 1 66 Query ALTER TABLEfeedback_recipesuggestion
AUTO_INCREMENT = 1 66 Query ALTER TABLEfacebook_facebookprofile
AUTO_INCREMENT = 1 66 Query ALTER TABLEtastypie_apiaccess
AUTO_INCREMENT = 1 121024 10:17:04 66 Query ALTER TABLEtastypie_apikey
AUTO_INCREMENT = 1 66 Query ALTER TABLEcelery_taskmeta
AUTO_INCREMENT = 1 66 Query ALTER TABLEcelery_tasksetmeta
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjcelery_intervalschedule
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjcelery_crontabschedule
AUTO_INCREMENT = 1 121024 10:17:05 72 Connect rohitjangid@localhost as on 72 Quit66 Query ALTER TABLE
djcelery_periodictask
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjcelery_workerstate
AUTO_INCREMENT = 1 66 Query ALTER TABLEdjcelery_taskstate
AUTO_INCREMENT = 1 121024 10:17:06 66 Query commit 66 Query CREATE TABLE ROLLBACK_TEST (X INT) 121024 10:17:07 73 Connect rohitjangid@localhost as on 73 Quit66 Query commit 66 Query INSERT INTO ROLLBACK_TEST (X) VALUES (8) 66 Query rollback 66 Query SELECT COUNT(X) FROM ROLLBACK_TEST 66 Query DROP TABLE ROLLBACK_TEST 66 Query commit 66 Query CREATE TABLE INTROSPECT_TEST (X INT) 66 Query SHOW TABLE STATUS WHERE Name="INTROSPECT_TEST" 66 Query DROP TABLE INTROSPECT_TEST 66 Quit