[dv/dvsim] Adds failure bucketizer for triage.
Changes _post_finish to take an ErrorMessage as second argument.
Moves class SimCfg's Results to its own file and renames it to SimResults.
The bucketizer is called when initializing SimResults.
This will change when reruns are implemented, since we would want to
rerun one test per bucket as soon as the failing test completes.
Signed-off-by: Guillermo Maturana <maturana@google.com>
diff --git a/util/dvsim/LsfLauncher.py b/util/dvsim/LsfLauncher.py
index 261d19c..e7119f0 100644
--- a/util/dvsim/LsfLauncher.py
+++ b/util/dvsim/LsfLauncher.py
@@ -9,7 +9,7 @@
import tarfile
from pathlib import Path
-from Launcher import Launcher, LauncherError
+from Launcher import ErrorMessage, Launcher, LauncherError
from utils import VERBOSE, clean_odirs
@@ -264,7 +264,11 @@
except IOError as e:
self._post_finish(
"F",
- "ERROR: Failed to open {}\n{}.".format(self.bsub_out, e))
+ ErrorMessage(
+ line_number=None,
+ message="ERROR: Failed to open {}\n{}.".format(
+ self.bsub_out, e),
+ context=[]))
return "F"
# Now that the job has completed, we need to determine its status.
@@ -299,7 +303,9 @@
status, err_msg = self._check_status()
# Prioritize error messages from bsub over the job's log file.
if self.bsub_out_err_msg:
- err_msg = self.bsub_out_err_msg
+ err_msg = ErrorMessage(line_number=None,
+ message=self.bsub_out_err_msg,
+ context=[])
self._post_finish(status, err_msg)
return status
@@ -396,4 +402,6 @@
err_msg is the error message indicating the cause of failure.'''
for job in LsfLauncher.jobs[cfg][job_name]:
- job._post_finish("F", err_msg)
+ job._post_finish("F", ErrorMessage(line_number=None,
+ message=err_msg,
+ context=[]))