[IMP] renamed server option --test-no-rollback to --test-commit, and dropped --test-continue, making it the default
bzr revid: odo@openerp.com-20100519153027-trhfaluudgo4f59z
This commit is contained in:
@@ -644,16 +644,13 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
|
||||
try:
|
||||
_load_data(cr, module_name, id_map, mode, 'test')
|
||||
except Exception, e:
|
||||
if tools.config.options['test-continue']:
|
||||
logger.notifyChannel('ERROR', netsvc.LOG_TEST, e)
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
logger.notifyChannel('ERROR', netsvc.LOG_TEST, e)
|
||||
pass
|
||||
finally:
|
||||
if tools.config.options['test-rollback']:
|
||||
cr.rollback()
|
||||
else:
|
||||
if tools.config.options['test-commit']:
|
||||
cr.commit()
|
||||
else:
|
||||
cr.rollback()
|
||||
|
||||
def _load_data(cr, module_name, id_map, mode, kind):
|
||||
noupdate = (kind == 'demo')
|
||||
|
||||
+4
-8
@@ -83,8 +83,7 @@ class configmanager(object):
|
||||
'list_db' : True,
|
||||
'timezone' : False, # to override the default TZ
|
||||
'test-disable' : False,
|
||||
'test-rollback' : True,
|
||||
'test-continue' : False
|
||||
'test-commit' : False,
|
||||
}
|
||||
|
||||
self.misc = {}
|
||||
@@ -142,10 +141,8 @@ class configmanager(object):
|
||||
group = optparse.OptionGroup(parser, "Testing Configuration")
|
||||
group.add_option("--test-disable", action="store_true", dest="test_disable",
|
||||
default=False, help="Disable loading test files.")
|
||||
group.add_option("--test-no-rollback", action="store_false", dest="test_rollback",
|
||||
default=True, help="Don't rollback after running test.")
|
||||
group.add_option("--test-continue", action="store_true", dest="test_continue",
|
||||
default=False, help="Display exception but then test should continue.")
|
||||
group.add_option("--test-commit", action="store_true", dest="test_commit",
|
||||
default=False, help="Commit database changes performed by tests.")
|
||||
parser.add_option_group(group)
|
||||
|
||||
# Logging Group
|
||||
@@ -288,8 +285,7 @@ class configmanager(object):
|
||||
self.options['init'] = opt.init and dict.fromkeys(opt.init.split(','), 1) or {}
|
||||
self.options["demo"] = not opt.without_demo and self.options['init'] or {}
|
||||
self.options["test-disable"] = opt.test_disable
|
||||
self.options["test-rollback"] = opt.test_rollback
|
||||
self.options["test-continue"] = opt.test_continue
|
||||
self.options["test-commit"] = opt.test_commit
|
||||
self.options['update'] = opt.update and dict.fromkeys(opt.update.split(','), 1) or {}
|
||||
|
||||
self.options['translate_modules'] = opt.translate_modules and map(lambda m: m.strip(), opt.translate_modules.split(',')) or ['all']
|
||||
|
||||
Reference in New Issue
Block a user