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