summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peres <martin.peres@linux.intel.com>2016-01-29 13:43:31 +0200
committerMartin Peres <martin.peres@linux.intel.com>2016-01-29 14:03:11 +0200
commit28d97ee823c6f4fdb3f631568b5cf2a05b7dcd91 (patch)
treeabe59b3a7233fe1a82d3f992c28ee927c76db8b3
parent77ee4c998f2f194602020204dfc336e317a92e3d (diff)
ezbench.py: make sure the exit_code is an instance of EzbenchExitCode
-rwxr-xr-xstats/compare_reports.py2
-rw-r--r--utils/ezbench.py11
2 files changed, 7 insertions, 6 deletions
diff --git a/stats/compare_reports.py b/stats/compare_reports.py
index 2ef31d7..fe9d160 100755
--- a/stats/compare_reports.py
+++ b/stats/compare_reports.py
@@ -118,7 +118,7 @@ for log_folder in args.log_folder:
db["commits"][commit.sha1] = dict()
db["commits"][commit.sha1]['reports'] = dict()
db["commits"][commit.sha1]['commit'] = commit
- if commit.compil_exit_code <= 0:
+ if not commit.build_broken():
db["commits"][commit.sha1]['build_color'] = "#00FF00"
else:
db["commits"][commit.sha1]['build_color'] = "#FF0000"
diff --git a/utils/ezbench.py b/utils/ezbench.py
index e33bbd7..375146f 100644
--- a/utils/ezbench.py
+++ b/utils/ezbench.py
@@ -48,6 +48,7 @@ import re
# Ezbench runs
class EzbenchExitCode(Enum):
+ UNKNOWN = -1
NO_ERROR = 0
ARG_PROFILE_NAME_MISSING = 11
ARG_PROFILE_INVALID = 12
@@ -900,20 +901,20 @@ class Commit:
pass
# Look for the exit code
- self.compil_exit_code = -1
+ self.compil_exit_code = EzbenchExitCode.UNKNOWN
try:
with open(compile_log, 'r') as f:
for line in f:
pass
# Line contains the last line of the report, parse it
if line.startswith("Exiting with error code "):
- self.compil_exit_code = int(line[24:])
+ self.compil_exit_code = EzbenchExitCode(int(line[24:]))
except IOError:
pass
def build_broken(self):
- return (self.compil_exit_code >= EzbenchExitCode.COMP_DEP_UNK_ERROR.value and
- self.compil_exit_code <= EzbenchExitCode.DEPLOYMENT_ERROR.value)
+ return (self.compil_exit_code.value >= EzbenchExitCode.COMP_DEP_UNK_ERROR.value and
+ self.compil_exit_code.value <= EzbenchExitCode.DEPLOYMENT_ERROR.value)
def geom_mean(self):
if self.geom_mean_cache >= 0:
@@ -1301,7 +1302,7 @@ def genPerformanceReport(log_folder, silentMode = False):
# Add the result to the commit's results
commit.results.append(result)
- commit.compil_exit_code = 0 # The deployment must have been successful if there is data
+ commit.compil_exit_code = EzbenchExitCode.NO_ERROR # The deployment must have been successful if there is data
# Add the commit to the list of commits
commit.results = sorted(commit.results, key=lambda res: res.benchmark.full_name)