Verified Commit 63580e28 authored by Sebastian Endres's avatar Sebastian Endres
Browse files

plot_all: Skip plots, when they could not be parsed before

parent be8b1efc
......@@ -120,7 +120,7 @@ class PlotAllCli:
if not measurement_result.succeeded and not self.include_failed:
cprint(
(
" Measurement "
" Measurement "
f"{measurement_result.log_dir_for_test.relative_to(self._current_log_dir)} "
"Failed. Skipping. Use --include-failed to include it anyway."
),
......@@ -180,21 +180,45 @@ class PlotAllCli:
rets = list[str]()
for mode in modes:
output_file = Path(test_case_dir / f"time_{mode.value}_plot.{self.format}")
output_file = test_case_dir / f"time_{mode.value}_plot.{self.format}"
err_output_file = test_case_dir / f"time_{mode.value}_plot_error.txt"
if not self.force:
if output_file.is_file():
cprint(
(
f"✔ {output_file.relative_to(self._current_log_dir)} already exists. "
"Skipping. Use --force to overwrite."
),
file=sys.stderr,
color="cyan",
)
if not self.force and output_file.is_file():
cprint(
(
f"⚒ {output_file.relative_to(self._current_log_dir)} already exists. "
"Skipping. Use --force to overwrite."
),
file=sys.stderr,
color="cyan",
)
rets.append("already exists")
rets.append("already exists")
continue
elif err_output_file.is_file():
with err_output_file.open("r") as file:
err_msg = file.read().strip()
continue
cprint(
(
"⨯ Trace could not be plotted in previous run. "
f"{err_output_file.relative_to(self._current_log_dir)} exists: "
),
file=sys.stderr,
color="red",
)
cprint(err_msg, file=sys.stderr, color="red")
cprint(
"Skipping. Use --force to overwrite.",
file=sys.stderr,
color="red",
)
rets.append(err_msg)
continue
cprint(
(
......@@ -230,6 +254,9 @@ class PlotAllCli:
)
cprint(f"⨯ {err}", file=sys.stderr, color="red")
with err_output_file.open("w") as file:
print(err, file=file)
rets.append(str(err))
continue
......
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