report-xfstests: Select a row in the [notrun] page to search

This is useful for figuring out exactly which tests weren't run for a
given reason.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
Anna Schumaker 2022-02-09 12:22:18 -05:00
parent 2ef3eea690
commit 088f2eead1
2 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/python
import re
from . import common
from . import testchooser
from . import testproperties
@ -30,13 +31,17 @@ class TestViewer(Gtk.Box):
def __init__(self):
Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)
self.stack = testproperties.Stack()
self.viewer = testviewer.Viewer()
self.switcher = Gtk.StackSwitcher(stack=self.stack, halign=Gtk.Align.CENTER)
self.viewer = testviewer.Viewer()
self.search = testviewer.SearchEntry(self.viewer.get_filter())
self.append(self.switcher)
self.append(self.stack)
self.append(self.viewer)
self.append(testviewer.SearchEntry(self.viewer.get_filter()))
self.append(self.search)
SizeGroup.add_widget(self.switcher)
self.stack.connect("notrun-selected", self.notrun_selected)
def set_test_result(self, file):
current = self.stack.clear()
@ -45,3 +50,6 @@ class TestViewer(Gtk.Box):
results = testresults.TestResults(file.path)
self.stack.show_properties(results, current)
self.viewer.show_results(results)
def notrun_selected(self, stack, item):
self.search.set_text(re.escape(item.message))

View File

@ -115,7 +115,7 @@ class View(Gtk.ColumnView):
class NotRunView(Gtk.ListView):
def __init__(self, notrun):
self.selection = Gtk.NoSelection.new(NotRunModel(notrun))
self.selection = Gtk.SingleSelection(autoselect=False, model=NotRunModel(notrun))
Gtk.ListView.__init__(self, model=self.selection, factory=NotRunFactory())
self.add_css_class("data-table")
@ -145,3 +145,10 @@ class Stack(Gtk.Stack):
self.add_titled(window, name, name)
if current == name:
self.set_visible_child(window)
child.selection.connect("selection-changed", self.selection_changed)
def selection_changed(self, selection, position, n_items):
self.emit("notrun-selected", selection.get_selected_item())
@GObject.Signal(arg_types=(NotRun,))
def notrun_selected(self, notrun): pass