mirror of https://github.com/zulip/zulip.git
tests: Don't regenerate the test database every time we run tests
This cuts about 6 seconds off of the test startup time on my laptop. The other startup costs are about 1 second for the server to come up and about half a second for casperjs to begin executing tests. generate-fixtures now takes a '--force' option that can be use to force a regeneration of the test database. (imported from commit 1f473507502f0edf159b2638abb392d9357eb46f)
This commit is contained in:
parent
707796b37b
commit
a84947eade
|
@ -1,6 +1,15 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
if [ -e zephyr/tests/zephyrdb.test.pristine ]; then
|
||||
if [ "$1" != "--force" ]; then
|
||||
cp zephyr/tests/zephyrdb.test.pristine zephyr/tests/zephyrdb.test
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p zephyr/fixtures
|
||||
rm -f zephyr/tests/zephyrdb.test
|
||||
rm -f zephyr/tests/zephyrdb.test.pristine
|
||||
|
||||
# Remove time.pyc to try to prevent it from screwing people importing
|
||||
# time from inside zephyr.lib. We can drop this hack after a bit.
|
||||
|
@ -16,3 +25,5 @@ python manage.py dumpdata --settings=humbug.test_settings \
|
|||
zephyr.Subscription zephyr.Message zephyr.Huddle zephyr.Realm \
|
||||
zephyr.UserMessage zephyr.Client \
|
||||
zephyr.DefaultStream > zephyr/fixtures/messages.json
|
||||
|
||||
cp zephyr/tests/zephyrdb.test zephyr/tests/zephyrdb.test.pristine
|
||||
|
|
Loading…
Reference in New Issue