Commit 1349c8db authored by Julien Muchembled's avatar Julien Muchembled

Re-setup matrix tests

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2782 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 9cd6472d
......@@ -287,12 +287,7 @@ class TestRunner(BenchmarkRunner):
if config.functional:
runner.run('Functional tests', FUNC_TEST_MODULES)
if config.zodb:
try:
from ZODB.interfaces import ReadVerifyingStorage
except ImportError:
logging.warn(" ZODB tests disabled on ZODB 3.9")
else:
runner.run('ZODB tests', ZODB_TEST_MODULES)
runner.run('ZODB tests', ZODB_TEST_MODULES)
except KeyboardInterrupt:
config['mail_to'] = None
traceback.print_exc()
......
......@@ -32,7 +32,7 @@ class BenchmarkRunner(object):
parser.add_option('', '--mail-to', action='append')
parser.add_option('', '--mail-from')
parser.add_option('', '--mail-server')
parser.add_option('-r', '--repeat', default=1)
parser.add_option('-r', '--repeat', type='int', default=1)
self.add_options(parser)
# check common arguments
options, self._args = parser.parse_args()
......
......@@ -9,21 +9,16 @@ from time import time
from neo.tests.benchmark import BenchmarkRunner
from ZODB.FileStorage import FileStorage
MIN_STORAGES = 1
MAX_STORAGES = 2
MIN_REPLICAS = 0
MAX_REPLICAS = 1
class MatrixImportBenchmark(BenchmarkRunner):
error_log = ''
def add_options(self, parser):
parser.add_option('-d', '--datafs')
parser.add_option('', '--min-storages')
parser.add_option('', '--max-storages')
parser.add_option('', '--min-replicas')
parser.add_option('', '--max-replicas')
parser.add_option('', '--min-storages', type='int', default=1)
parser.add_option('', '--max-storages', type='int', default=2)
parser.add_option('', '--min-replicas', type='int', default=0)
parser.add_option('', '--max-replicas', type='int', default=1)
parser.add_option('', '--threaded', action="store_true")
def load_options(self, options, args):
......@@ -31,10 +26,10 @@ class MatrixImportBenchmark(BenchmarkRunner):
sys.exit('Missing or wrong data.fs argument')
return dict(
datafs = options.datafs,
min_s = int(options.min_storages or MIN_STORAGES),
max_s = int(options.max_storages or MAX_STORAGES),
min_r = int(options.min_replicas or MIN_REPLICAS),
max_r = int(options.max_replicas or MAX_REPLICAS),
min_s = options.min_storages,
max_s = options.max_storages,
min_r = options.min_replicas,
max_r = options.max_replicas,
threaded = options.threaded,
)
......@@ -155,11 +150,8 @@ class MatrixImportBenchmark(BenchmarkRunner):
report += sep
report += self.error_log
if failures:
info = '%d failures' % (failures, )
else:
info = '%.1f KB/s' % (sum(speedlist) / len(speedlist))
summary = 'Matrix : %s ' % (info, )
return (summary, report)
return '%d failures' % (failures, )
return '%.1f KB/s' % (sum(speedlist) / len(speedlist))
def main(args=None):
MatrixImportBenchmark().run()
......
......@@ -44,13 +44,24 @@ def main():
os.execvp(sys.argv[0], sys.argv)
delay = None
for test_home in sys.argv[arg_count:]:
test_home, tasks = test_home.rsplit('=', 1)
tests = ''.join(x for x in tasks if x in 'fuz')
bin = os.path.join(test_home, 'bin')
if not subprocess.call((os.path.join(bin, 'buildout'), '-v'),
cwd=test_home):
subprocess.call([os.path.join(bin, 'neotestrunner'), '-fuz',
'--title', 'NEO tests (r%u-%s)'
% (revision, os.path.basename(test_home)),
] + sys.argv[1:arg_count])
title = '(r%u-%s)' % (revision, os.path.basename(test_home))
if tests:
subprocess.call([os.path.join(bin, 'neotestrunner'),
'-' + tests, '--title',
'NEO tests ' + title,
] + sys.argv[1:arg_count])
if 'm' in tasks:
subprocess.call([os.path.join(bin, 'python'),
'tools/matrix', '--repeat=3',
'--min-storages=1', '--max-storages=24',
'--min-replicas=0', '--max-replicas=3',
'--title', 'Matrix ' + title,
] + sys.argv[1:arg_count])
clean()
if __name__ == '__main__':
......
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