mirror of https://github.com/zulip/zulip.git
Add call to generate-fixtures in test-backend.
Add call to tools/generate-fixtures in tools/test-backend before starting the tests. Previously, test-backend could fail if called after tools/test-js-with-casper had failed. Fixes #501.
This commit is contained in:
parent
01bfa2d94d
commit
3ab567db98
|
@ -4,13 +4,15 @@ from __future__ import print_function
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
import django
|
import django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.test.utils import get_runner
|
from django.test.utils import get_runner
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
sys.path.insert(0, os.path.dirname(TOOLS_DIR))
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
|
||||||
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess
|
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess
|
||||||
os.environ['PYTHONUNBUFFERED'] = 'y'
|
os.environ['PYTHONUNBUFFERED'] = 'y'
|
||||||
|
@ -41,6 +43,8 @@ if __name__ == "__main__":
|
||||||
prof = cProfile.Profile()
|
prof = cProfile.Profile()
|
||||||
prof.enable()
|
prof.enable()
|
||||||
|
|
||||||
|
subprocess.call(os.path.join(TOOLS_DIR, 'generate-fixtures'))
|
||||||
|
|
||||||
TestRunner = get_runner(settings)
|
TestRunner = get_runner(settings)
|
||||||
test_runner = TestRunner()
|
test_runner = TestRunner()
|
||||||
failures = test_runner.run_tests(suites, fatal_errors=options.fatal_errors)
|
failures = test_runner.run_tests(suites, fatal_errors=options.fatal_errors)
|
||||||
|
|
Loading…
Reference in New Issue