Commit a6afbc8e authored by Jérome Perrin's avatar Jérome Perrin

use INSTANCE_HOME environment variable, which is always set by either...

use INSTANCE_HOME environment variable, which is always set by either runUnitTest.py or zopectl. Also warn when previous dump is not found

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35490 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b32c6e8b
...@@ -9,11 +9,12 @@ from asyncore import socket_map ...@@ -9,11 +9,12 @@ from asyncore import socket_map
from ZODB.DemoStorage import DemoStorage from ZODB.DemoStorage import DemoStorage
from ZODB.FileStorage import FileStorage from ZODB.FileStorage import FileStorage
from Products.ERP5Type.tests.utils import getMySQLArguments, instance_random from Products.ERP5Type.tests.utils import getMySQLArguments, instance_random
from Products.ERP5Type.tests.runUnitTest import instance_home, static_dir_list from Products.ERP5Type.tests.runUnitTest import static_dir_list
def _print(message): def _print(message):
sys.stderr.write(message + "\n") sys.stderr.write(message + "\n")
instance_home = os.environ['INSTANCE_HOME']
zserver_list = os.environ.get('zserver', '').split(',') zserver_list = os.environ.get('zserver', '').split(',')
os.environ['zserver'] = zserver_list[0] os.environ['zserver'] = zserver_list[0]
...@@ -56,6 +57,7 @@ if load: ...@@ -56,6 +57,7 @@ if load:
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:
_print("Could not find MySQL dump, will recreate catalog ... ")
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 static_dir_list: for dir in static_dir_list:
......
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