Verified Commit f2bb6fdb authored by Sebastian Endres's avatar Sebastian Endres
Browse files

More edge cases for results_parser

parent 4c607d11
......@@ -21,7 +21,9 @@ class RawTest(TypedDict):
desc: str
RawTestResultResult = Union[Literal["succeeded"], Literal["failed"]]
RawTestResultResult = Union[
None, Literal["succeeded"], Literal["failed"], Literal["unsupported"]
]
class RawTestResult(TypedDict):
......@@ -144,12 +146,16 @@ class ExtendedMeasurementResult(_ExtendedTestResultMixin):
@cached_property
def repetition_log_dirs(self) -> list[Path]:
"""Return a list of log dirs for each test repetition."""
repetitions = sorted(
iterdir
for iterdir in self.log_dir_for_test.iterdir()
if iterdir.is_dir() and iterdir.name.isnumeric()
)
repetition_nums = [int(iterdir.name) for iterdir in repetitions]
try:
repetitions = sorted(
iterdir
for iterdir in self.log_dir_for_test.iterdir()
if iterdir.is_dir() and iterdir.name.isnumeric()
)
repetition_nums = [int(iterdir.name) for iterdir in repetitions]
except FileNotFoundError as err:
breakpoint()
raise err
for index, cur_num in enumerate(repetition_nums):
if index + 1 != cur_num:
......@@ -293,8 +299,11 @@ class Result:
@property
def log_dir(self) -> Path:
"""The path to the detailed logs."""
return Path(self.raw_data["log_dir"])
log_dir = Path(self.raw_data["log_dir"])
if log_dir.is_absolute():
return log_dir
else:
return self.file_path.parent / log_dir
@log_dir.setter
def log_dir(self, value: Path):
......@@ -535,6 +544,8 @@ class Result:
index = client_index * len(self.servers) + server_index
for test in self.raw_data["results"][index]:
if not test["result"]:
continue
ext_result = ExtendedTestResult(
result=test["result"],
server=server,
......@@ -562,6 +573,8 @@ class Result:
index = client_index * len(self.servers) + server_index
for measurement in self.raw_data["measurements"][index]:
if not measurement["result"]:
continue
ext_result = ExtendedMeasurementResult(
result=measurement["result"],
details=measurement["details"],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment