Skip to content

Commit

Permalink
better status text for bisection step report view
Browse files Browse the repository at this point in the history
  • Loading branch information
parkouss committed Mar 28, 2015
1 parent 6ac8b6b commit 292c9ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions gui/mozregui/bisection.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class GuiBisector(QObject, Bisector):
finished = Signal(object, int)
step_started = Signal(object)
step_build_found = Signal(object, object)
step_testing = Signal(object, object)
step_finished = Signal(object, str)

def __init__(self, fetch_config, persist=None):
Expand Down Expand Up @@ -171,6 +172,7 @@ def _build_dl_finished(self, dl, dest):
if dl is not None and (dl.is_canceled() or dl.error()):
# todo handle this
return
self.step_testing.emit(self.bisection, self.build_infos)
# call this in the thread
QTimer.singleShot(0, self._evaluate)

Expand Down
17 changes: 14 additions & 3 deletions gui/mozregui/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,19 @@ class StepItem(ReportItem):
"""
def __init__(self):
ReportItem.__init__(self)
self.state_text = 'Found'
self.verdict = None

def status_text(self):
if not self.data:
return ReportItem.status_text(self)
if self.data['build_type'] == 'nightly':
msg = "Found nightly build: %s" % self.data['build_date']
msg = "%%s nightly build: %s" % self.data['build_date']
else:
msg = "Found inbound build: %s" % self.data['changeset']
msg = "%%s inbound build: %s" % self.data['changeset']
if self.verdict is not None:
msg += ' (verdict: %s)' % self.verdict
return msg
return msg % self.state_text


class ReportModel(QAbstractTableModel):
Expand All @@ -71,6 +72,7 @@ def clear(self):
def attach_bisector(self, bisector):
bisector.step_started.connect(self.step_started)
bisector.step_build_found.connect(self.step_build_found)
bisector.step_testing.connect(self.step_testing)
bisector.step_finished.connect(self.step_finished)
bisector.started.connect(self.started)
bisector.finished.connect(self.finished)
Expand Down Expand Up @@ -123,17 +125,26 @@ def step_build_found(self, bisection, build_infos):

# and add the new step with build_infos
item = StepItem()
item.state_text = 'Downloading'
item.data.update(build_infos)
self.append_item(item)
else:
# previous item is a step, just update it
last_item.data.update(build_infos)
last_item.state_text = 'Downloading'
self.update_item(last_item)

@Slot(object, int, object)
def step_testing(self, bisection, build_infos):
last_item = self.items[-1]
last_item.state_text = 'Testing'
self.update_item(last_item)

@Slot(object, int, str)
def step_finished(self, bisection, verdict):
# step finished, just store the verdict
item = self.items[-1]
item.state_text = 'Tested'
item.verdict = verdict
self.update_item(item)

Expand Down

0 comments on commit 292c9ec

Please sign in to comment.