0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-27 23:27:11 +01:00
mongodb/buildscripts/resmokelib/reportfile.py
2020-06-18 10:21:48 +00:00

22 lines
581 B
Python

"""Manage interactions with the report.json file."""
import json
from buildscripts.resmokelib import config
from buildscripts.resmokelib.testing import report as _report
def write(suites):
"""Write the combined report of all executions if --reportFile was specified."""
if config.REPORT_FILE is None:
return
reports = []
for suite in suites:
reports.extend(suite.get_reports())
combined_report_dict = _report.TestReport.combine(*reports).as_dict()
with open(config.REPORT_FILE, "w") as fp:
json.dump(combined_report_dict, fp)