Commit 96a6e0e4 authored by Denis Bilenko's avatar Denis Bilenko

testrunner: read changeset/version info once for all tests

parent 31067e5e
...@@ -264,22 +264,16 @@ def run_subprocess(arg, options): ...@@ -264,22 +264,16 @@ def run_subprocess(arg, options):
return retcode[0], output, output_printed return retcode[0], output, output_printed
def spawn_subprocess(arg, options): def spawn_subprocess(arg, options, base_params):
success = False success = False
if options.db: if options.db:
module_name = arg module_name = arg
if module_name.endswith('.py'): if module_name.endswith('.py'):
module_name = module_name[:-3] module_name = module_name[:-3]
from datetime import datetime from datetime import datetime
params = {'started_at': datetime.now(), params = base_params.copy()
'runid': options.runid, params.update({'started_at': datetime.now(),
'test': module_name, 'test': module_name})
'python': '%s.%s.%s' % sys.version_info[:3],
'changeset': get_changeset(),
'libevent_version': get_libevent_version(),
'libevent_method': get_libevent_method(),
'uname': options.uname,
'retcode': 'TIMEOUT'}
row_id = store_record(options.db, 'test', params) row_id = store_record(options.db, 'test', params)
params['id'] = row_id params['id'] = row_id
retcode, output, output_printed = run_subprocess(arg, options) retcode, output, output_printed = run_subprocess(arg, options)
...@@ -304,14 +298,20 @@ def spawn_subprocess(arg, options): ...@@ -304,14 +298,20 @@ def spawn_subprocess(arg, options):
def spawn_subprocesses(options, args): def spawn_subprocesses(options, args):
params = {'runid': options.runid,
'python': '%s.%s.%s' % sys.version_info[:3],
'changeset': get_changeset(),
'libevent_version': get_libevent_version(),
'libevent_method': get_libevent_method(),
'uname': platform.uname()[0],
'retcode': 'TIMEOUT'}
success = True success = True
if not args: if not args:
args = glob.glob('test_*.py') args = glob.glob('test_*.py')
args.remove('test_support.py') args.remove('test_support.py')
options.uname = platform.uname()[0]
for arg in args: for arg in args:
try: try:
success = spawn_subprocess(arg, options) and success success = spawn_subprocess(arg, options, params) and success
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
if options.db: if options.db:
......
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