Add experiments timings to data to submit to DB(#5108)

This commit is contained in:
Alexander Shchepetov 2021-04-12 09:29:10 +03:00 committed by GitHub
parent 9f93509b1c
commit e864972f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -105,7 +105,7 @@ def run_timetest(args: dict, log=None):
aggregated_stats = aggregate_stats(filtered_stats)
log.debug("Aggregated statistics after full run: {}".format(aggregated_stats))
return 0, aggregated_stats
return 0, aggregated_stats, stats
def check_positive_int(val):
@ -154,7 +154,7 @@ if __name__ == "__main__":
logging.basicConfig(format="[ %(levelname)s ] %(message)s",
level=logging.DEBUG, stream=sys.stdout)
exit_code, aggr_stats = run_timetest(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access
exit_code, aggr_stats, _ = run_timetest(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access
if args.stats_path:
# Save aggregated results to a file

View File

@ -161,6 +161,7 @@ def test_info(request, pytestconfig):
"""
setattr(request.node._request, "test_info", {"orig_instance": request.node.funcargs["instance"],
"results": {},
"raw_results": {},
"db_info": {}})
if not hasattr(pytestconfig, "session_info"):
setattr(pytestconfig, "session_info", [])
@ -391,6 +392,7 @@ def pytest_runtest_makereport(item, call):
data = item._request.test_info["db_info"].copy()
data["results"] = item._request.test_info["results"].copy()
data["raw_results"] = item._request.test_info["raw_results"].copy()
data["status"] = "not_finished"
data["error_msg"] = ""

View File

@ -63,11 +63,12 @@ def test_timetest(instance, executable, niter, cl_cache_dir, test_info, temp_dir
run_timetest(_exe_args, log=logging)
assert os.listdir(cl_cache_dir), "cl_cache isn't generated"
retcode, aggr_stats = run_timetest(exe_args, log=logging)
retcode, aggr_stats, raw_stats = run_timetest(exe_args, log=logging)
assert retcode == 0, "Run of executable failed"
# Add timetest results to submit to database and save in new test conf as references
test_info["results"] = aggr_stats
test_info["raw_results"] = raw_stats
# Compare with references
comparison_status = 0