Commit 5d3b0c78 authored by Julien Muchembled's avatar Julien Muchembled

Tweak again output on test startup because ZopeLite is always quiet since r30352

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30371 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 38f22d65
...@@ -15,12 +15,12 @@ save = int(os.environ.get('erp5_save_data_fs', 0)) ...@@ -15,12 +15,12 @@ save = int(os.environ.get('erp5_save_data_fs', 0))
if load: if load:
dump_sql = os.path.join(instance_home, 'dump.sql') dump_sql = os.path.join(instance_home, 'dump.sql')
if os.path.exists(dump_sql): if os.path.exists(dump_sql):
print "Restoring MySQL database ... ", print "Restoring MySQL database ...",
ret = os.system("mysql %s < %s" % (getMySQLArguments(), dump_sql)) ret = os.system("mysql %s < %s" % (getMySQLArguments(), dump_sql))
assert not ret assert not ret
else: else:
os.environ['erp5_tests_recreate_catalog'] = '1' os.environ['erp5_tests_recreate_catalog'] = '1'
print "Restoring static files ... ", print "Restoring static files ...",
for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'): for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'):
if os.path.exists(os.path.join(instance_home, '%s.bak' % dir)): if os.path.exists(os.path.join(instance_home, '%s.bak' % dir)):
full_path = os.path.join(instance_home, dir) full_path = os.path.join(instance_home, dir)
...@@ -28,7 +28,7 @@ if load: ...@@ -28,7 +28,7 @@ if load:
shutil.copytree(os.path.join(instance_home, '%s.bak' % dir), shutil.copytree(os.path.join(instance_home, '%s.bak' % dir),
full_path, symlinks=True) full_path, symlinks=True)
else: else:
print "Cleaning static files at %s ... " % instance_home, print "Cleaning static files ...",
for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'): for dir in ('Constraint', 'Document', 'PropertySheet', 'Extensions'):
full_path = os.path.join(instance_home, dir) full_path = os.path.join(instance_home, dir)
if os.path.exists(full_path): if os.path.exists(full_path):
...@@ -45,3 +45,4 @@ elif load: ...@@ -45,3 +45,4 @@ elif load:
else: else:
Storage = DemoStorage() Storage = DemoStorage()
print "Instance at %r loaded ..." % instance_home,
...@@ -3,6 +3,7 @@ import os ...@@ -3,6 +3,7 @@ import os
import sys import sys
import pdb import pdb
import re import re
import time
import getopt import getopt
import unittest import unittest
import shutil import shutil
...@@ -302,6 +303,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0): ...@@ -302,6 +303,9 @@ def runUnitTestList(test_list, verbosity=1, debug=0):
os.environ.setdefault('EVENT_LOG_FILE', os.path.join(tests_home, 'zLOG.log')) os.environ.setdefault('EVENT_LOG_FILE', os.path.join(tests_home, 'zLOG.log'))
os.environ.setdefault('EVENT_LOG_SEVERITY', '-300') os.environ.setdefault('EVENT_LOG_SEVERITY', '-300')
print "Loading Zope ...",
_start = time.time()
import Testing import Testing
# the above import changes cfg.testinghome. Reset it to where our # the above import changes cfg.testinghome. Reset it to where our
# custom_zodb.py can be found. This must be done before importing # custom_zodb.py can be found. This must be done before importing
...@@ -426,6 +430,8 @@ def runUnitTestList(test_list, verbosity=1, debug=0): ...@@ -426,6 +430,8 @@ def runUnitTestList(test_list, verbosity=1, debug=0):
# be faster and we could drop most of this code we currently maintain # be faster and we could drop most of this code we currently maintain
# ourselves # ourselves
layer.ZopeLite.setUp() layer.ZopeLite.setUp()
print 'done (%.3fs)' % (time.time() - _start),
result = TestRunner(verbosity=verbosity).run(suite) result = TestRunner(verbosity=verbosity).run(suite)
if save: if save:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment