Commit Graph

80 Commits

Author SHA1 Message Date
Anna Schumaker 528444cab6 xfstestsdb 1.5
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 15:52:28 -04:00
Anna Schumaker 952889687f gtk: Add a MessagesView to the XfstestsView
This is placed in a Gtk.Stack with a nice transition to show the failed
tests log.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 15:35:28 -04:00
Anna Schumaker ea2913429c gtk: Create a MessagesView
The MessagesView combines two MessageViews into a split-pane card. This
lets us display stdout and stderr side-by-side to the user so they can
see what is going on. I also add a 'back' button that the user can click
to signal that they are done reviewing the output.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 15:34:18 -04:00
Anna Schumaker 5fb9bd6221 gtk: Create a MessageView
The message view will be used to display either stdout or stderr
messages to the user. It has built-in 'diff' detection, and adds nice
colors to the diff output if we are asked to display one.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 15:31:09 -04:00
Anna Schumaker 54be8f5ce3 gtk: Give the TestCaseView a show-messages signal
This simply passes on the signal from the underlying factory to be used
in a higher up layer.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 13:16:17 -04:00
Anna Schumaker 5a25935fed gtk: Emit a signal when a specific test result is clicked
I only do this for failing tests that have text set in their stdout or
stderr properties. I also update the CSS for failed tests to give an
indication when users hover their mouse over them.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-31 13:16:16 -04:00
Anna Schumaker 40b1d1789d gtk: Add the EnvironmentView to the XfstestsView
And set the environment property from the application after creating a
property list.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 17:17:34 -04:00
Anna Schumaker f44e064c89 gtk: Create an EnvironmentView
The EnvironmentView is a ColumnView configured to display environment
properties to the user. It doesn't use the firstcol property at all, so
some extra handling of the model property was needed.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 17:16:39 -04:00
Anna Schumaker 02452069da gtk: Create an EnvironmentFactory
This is different from our other xunit factories. Instead of displaying
values for each xunit, it looks into what we determine to be environment
properties and displays those instead.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 17:15:17 -04:00
Anna Schumaker 7c7e279648 model: Give the PropertyList "environment" detection
I define the envorionment as properties that are the same across each
added xunit, as long as there are more than 1 added xunits. I add an
'environment' property to make it easy to get the current set of
environment properties.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 16:13:07 -04:00
Anna Schumaker c861c49564 gtk: Add an XunitView base class
The XunitView implements most of the work needed by our various views to
show xfstests results.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 15:34:27 -04:00
Anna Schumaker a5d1ae4607 gtk: Create an XunitFactory base class
And convert most of our Factory implementations to inherit from it. This
lets me set up the xunit property in one single place, and soon I'll be
using this factory for a XunitView base class.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 15:27:50 -04:00
Anna Schumaker 2deb484754 xfstestsdb 1.4
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-29 10:43:41 -04:00
Anna Schumaker af1ab81ea2 gtk: Increase the default Window size
Now that we've added properties, we need a slightly larger window to
display everything clearly.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-16 10:34:21 -04:00
Anna Schumaker 3dc8179624 gtk: Add a PropertyView to the XfstestsView
And have the application create a PropertyList that is passed to the
View.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-16 10:34:21 -04:00
Anna Schumaker c145a67ae6 gtk: Add a PropertyView
The PropertyView displays the properties of each Xunit added to the
displayed Xfstests run.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-16 10:34:21 -04:00
Anna Schumaker 7ae246677b gtk: Add a PropertyFactory
The PropertyFactory is used to display the individual property rows from
each xunit.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-16 10:34:21 -04:00
Anna Schumaker 59cb699bd9 gtk: Add a PropertyList model
Along with Property, PropertyValue, and PropertyFilter objects that are used
togther to show specific properties to the user when placed in a
Gtk.ColumnView.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-16 10:34:20 -04:00
Anna Schumaker 4838889c56 gtk: Create a Factory base class
And convert our other Factory instances to inherit from it. This lets me
set up a Gtk.Inscription() in a singe way that is used everywere, and
abstract out some other binding code to make implementing new factories
easier.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-15 16:37:55 -04:00
Anna Schumaker 5dc7735ba7 gtk: Create an XunitList base class
The XunitList implements the Gio.ListModel interface, and builds in some
virtual functions to query and fill out the rows in the list in a
standard way. I also update the TestCaseList and SummaryList to both
inherit from this class.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-15 13:56:27 -04:00
Anna Schumaker c45ec1909e gtk: Create an XunitRow base class
This Object is intended to be returned by a Gio.ListModel to show
Xfstests xunit information. I change the TestCase and Summary classes to
inherit from this class, removing a lot of duplicated code.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-15 13:01:24 -04:00
Anna Schumaker ad08357121 gtk: Create a XunitCell object and rename the XunitResult object
I use the XunitCell as a base class for the (renamed) TestResult and
SettingsValue objects. This lets us combine common values and
functionality in one reusable place.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-15 13:00:51 -04:00
Anna Schumaker 4d3425bb57 xfstestsdb 1.3
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-15 10:57:27 -04:00
Anna Schumaker 455d933fc4 gtk: Create a SummaryView
The SummaryView displays a summary of the passed, failed, and skipped
tests for each xunit along with the time it took the xunit to run.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 16:06:32 -04:00
Anna Schumaker 8a5bc1527a gtk: Create a SummaryFactory
This is a Gtk.ListItemFactory that creates a Label widget and binds
xunit summaries to it. I use the summary field name to apply an
appropriate CSS class to each label.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 16:03:06 -04:00
Anna Schumaker d92b8148bf gtk: LabelFactory improvements
I add a global SizeGroup to the LabelFactory so the first column of each
table I make can have the same width. I also add style classes that are
applied with specific item values, which will mostly be used by the
SummaryView labels.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 16:02:21 -04:00
Anna Schumaker e14667691a gtk: Add a SummaryList Gio.ListModel
This is a list model designed to show a summary of xfstests results for
a given runid. I create a new one whenever the Application changes the
runid.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:41:05 -04:00
Anna Schumaker b143114108 gtk: Add SummaryValue and Summary objects
These are the underlying GObjects that will be returned by a SummaryList
ListModel.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:41:04 -04:00
Anna Schumaker 8a54cb5d98 gtk: Put the TestResultList behind a TestCaseFilter
And control the filter using the newly-created FilterButtons class. This
lets us hide completely skipped tests by default, since those are mostly
noise. I also add some custom icons used by the buttons to indicate
passed, failed, or skipped tests.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:41:02 -04:00
Anna Schumaker 37079ca7f5 gtk: Add a custom StatusToggle button
This is a Gtk.Button that has been customized to act similarily to a
Gtk.ToggleButton, but instead of giving the button a "pressed in" look
it changes the opacity of the displayed icon.

I'm planning to use this in the window headerbar in a set of buttons
designed to controll testcase filter state.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:35:01 -04:00
Anna Schumaker e865728357 gtk: Add a TestCaseFilter Gtk.Filter
This filter will be used to search the TestCaseList.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:35:00 -04:00
Anna Schumaker e0bb2d7be7 gtk: Display TestCase results in the TestCaseView
I use the ResultFactory to do this. I also create a custom css
stylesheet to use for each cell in the Gtk.ColumnView displaying the
results. This lets us add custom colors so we can easily see at a glance
what is failing, passing, or skipped.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:34:57 -04:00
Anna Schumaker 8ef06e9571 gtk: Create a ResultsFactory
This is a Gtk.ListItemFactory that creates a Label widget and binds
testcase results to it. I use the result status as the name of a CSS
class that will be created in the next patch so the ColumnView cells
have a nicer presentation.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:30:51 -04:00
Anna Schumaker 796cf6eec7 gtk: Create a TestCaseView and XfstestsView
The XfstestsView contains the TestCaseView, and will eventually contain
other views used to display test results and information.

For the moment, the TestCaseView displays the name of the testcases in a
single Xfstests run in a single column. I plan on adding more columns in
the near future.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 13:27:22 -04:00
Anna Schumaker 4bce147e45 gtk: Create a LabelFactory
This is a Gtk.ListItemFactory that creates a Label widget and binds a
generic property to it.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 10:17:10 -04:00
Anna Schumaker 7adbb5938d gtk: Add a TestCaseList Gio.ListModel
This is a list model designed to show xfstests results for a given
runid. I create a new one whenever the Application changes the runid.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 10:17:10 -04:00
Anna Schumaker 15cee521c2 gtk: Add TestCase and XunitResult objects
These are the underlying GObjects that will be returned by a
TestCaseList ListModel.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 10:17:10 -04:00
Anna Schumaker c1b73748f1 gtk: Add a window to the Application
This is an empty Adw.Window with a headerbar configured to display the
application name. I also bind the Application runid property to the
Window to print out the currently displayed run.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-14 10:17:08 -04:00
Anna Schumaker d5413700f0 gtk: Give the gtk command a `runid` argument
This argument is passed to the Application using the 'command-line'
signal, so a running Application can switch to a new runid when
requested.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-01 17:01:33 -04:00
Anna Schumaker 62bf603ca4 gtk: Add the `xfstestsdb gtk` command
This command doesn't do much at the moment, it simply sets up the Gtk
Application and then exits. The actual UI will be built up over the next
several patches.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-08-01 17:01:29 -04:00
Anna Schumaker bea49c5eae xfstestsdb 1.2
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-26 11:27:32 -04:00
Anna Schumaker 14654dcf23 gc: Create the `xfstestsdb gc` command
This command is used to garbage collect the xfstestsdb sqlite database.
It removes xfstests runs that have no added xunits, and runs older than
180 days that have not been tagged.

Implements: #16 (`xfstestsdb gc`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-26 11:26:09 -04:00
Anna Schumaker 68a00ea94d xunit: Create the `xfstestsdb xunit gc` command
This command is used to garbage collect the xunit table by removing
xunits that have no testcases. This could be expanded on later to add
more removal conditions, such as xunits older than some age.

Implements: #15 (`xfstestsdb xunit gc`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-26 11:26:08 -04:00
Anna Schumaker c3eb740fb5 xunit delete: Xunit property performance improvements
I found that deleting an xunit from the database was very, very slow.
This patch addresses the issue by adding additional indexes on the
link_xunit_properties table to make it easier to find properties that
are still in use. I also rework the `cleanup_xunit_properties` trigger
to only check propids that were used by the deleted xunit.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-25 12:42:30 -04:00
Anna Schumaker a168a7f84b xunit delete: Testcase message performance improvements
I found that deleting an xunit from the database was very, very slow.
This patch addresses the issue by adding additional indexes on the
testcases table to make it easier to find messages that are still in
use. I also rework the `cleanup_testcase_messages` trigger to only check
messageids that were used by the deleted testcase.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-25 10:41:58 -04:00
Anna Schumaker 2082b904a0 sqlite: Add an upgrade script to database version 2
Right now it doesn't do any extra changes to the database besides
bumping the user_version to '2'. I'll fill it out over the next several
commits.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-25 10:03:32 -04:00
Anna Schumaker 3f61adc941 sqlite: Give the Connection an executescript() function
This function builds on the built-in Python function, and adds in
opening and reading the file in a way that can be used for running
generic scripts on the database.

I also take this chance to move SQL scripts into a subdirectory to keep
them together.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-07-25 09:54:31 -04:00
Anna Schumaker 14b848bddd xfstestsdb v1.1
- Updates for recent xfstests xunit generation changes
- Fix the `xunit delete` command
- Make sure SQLite foreign_keys are always enabled

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-04-17 15:58:00 -04:00
Anna Schumaker 5d141bd436 sqlite: Make sure foreign_keys are enabled
SQLite wants foreign_keys to be enabled for each connection, and doesn't
save this setting.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-04-17 15:57:47 -04:00
Anna Schumaker 8a70fa6427 xunit: Fix `xunit delete`
xunit delete was incorrectly passing "rowid=" instead of "runid=" to the
sql DELETE statement.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-04-17 14:35:29 -04:00