Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions infra/build/build_status/fuzz_introspector_page_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ def fetch_fuzz_introspector_summary(report_url):
"""
# Extract json summary file.
summary_url = report_url.replace('fuzz_report.html', 'summary.json')
response = urlopen(summary_url)
json_data = json.loads(response.read())
with urlopen(summary_url) as response:
json_data = json.loads(response.read())

# 1) Extract fuzzer count. This corresponds to all but two elements at the
# top level of the dictionary.
Expand All @@ -251,7 +251,8 @@ def fetch_fuzz_introspector_summary(report_url):
# Momentarily, we will get this from the HTML page because it's not yet
# in the summary.json. This will change in the near future, but in the
# spirit of time we keep it like this for now.
fuzz_report_html = urlopen(report_url).read()
with urlopen(report_url) as resp:
fuzz_report_html = resp.read()
soup = BeautifulSoup(fuzz_report_html, 'html.parser')
target_divs = soup.findAll('text', {'class': 'percentage'})

Expand Down
5 changes: 2 additions & 3 deletions infra/chronos/coverage_test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ def run_llvm_html_generation(objects, out_dir, workdir=COV_WORKDIR):
f'-instr-profile={instr_profile}',
objects,
]
stdout_fp = open(os.path.join(out_dir, 'summary.json'), 'w')
subprocess.check_call(' '.join(cmd), shell=True, stdout=stdout_fp)
stdout_fp.close()
with open(os.path.join(out_dir, 'summary.json'), 'w') as stdout_fp:
subprocess.check_call(' '.join(cmd), shell=True, stdout=stdout_fp)


def reset_cov_workdir():
Expand Down