Skip to content

Commit

Permalink
Catch URL error if remote stats bucket does not exist
Browse files Browse the repository at this point in the history
When creating a new IP or moving an IP to ipgen, there is no initial
regression run. Consequently, fetching its stats fails as the remote
path does not exist.

To unblock this error, this PR catches the URL error if the path does
not exist and returns that 0 runs out of 0 are performed.

Signed-off-by: Robert Schilling <rschilling@rivosinc.com>
  • Loading branch information
Razer6 authored and jwnrt committed Jan 9, 2025
1 parent 2397088 commit aac71e4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions util/site/fetch_block_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
and bundles it into one json file.
"""
from urllib.request import urlopen
from urllib.error import HTTPError
import itertools as it
import json
from pathlib import Path
Expand Down Expand Up @@ -57,8 +58,12 @@


def parse_report(path: str) -> Tuple[int, int]:
with urlopen(f'https://reports.opentitan.org/{path}/report.json') as response:
report = json.load(response)
try:
with urlopen(f'https://reports.opentitan.org/{path}/report.json') as response:
report = json.load(response)
except HTTPError:
# URL does not exist, there are no test runs yet for that
return (0, 0)

# Extract all tests from the report.
testpoints = report['results']['testpoints']
Expand Down

0 comments on commit aac71e4

Please sign in to comment.