in bot/code_coverage_bot/hooks/base.py [0:0]
def build_reports(self, only=None):
"""
Build all the possible covdir reports using current artifacts
"""
os.makedirs(self.reports_dir, exist_ok=True)
reports = {}
for (
(platform, suite),
artifacts,
) in self.artifactsHandler.get_combinations().items():
if only is not None and (platform, suite) not in only:
continue
# Generate covdir report for that suite & platform
logger.info(
"Building covdir suite report",
suite=suite,
platform=platform,
artifacts=len(artifacts),
)
output = grcov.report(
artifacts, source_dir=self.repo_dir, out_format="covdir"
)
# Write output on FS
path = os.path.join(self.reports_dir, f"{platform}.{suite}.json")
with open(path, "wb") as f:
f.write(output)
reports[(platform, suite)] = path
return reports