Commit Graph

68 Commits

Author SHA1 Message Date
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
Anna Schumaker ee6c758943 xunit: Update read.py for the recent xunit changes
The xfstests xunit generation has been updated to include an xml
namespace and add some extra attributes to the root element. This broke
my xunit parsing code, which is fixed with this patch.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-04-17 14:15:44 -04:00
Anna Schumaker b8460bfa60 Makefile: Add 'install' and 'uninstall' targets
I install to /usr/local by default, but this can be overridden by
setting PREFIX when running `make`

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker 8311cbe478 Update 'README.md'
Update the README file for the initial release.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker 1996f3b798 xfstestsdb: Create the `xfstestsdb show` command
This command generates a table from the testcases that have been added
to a single run so the results of each testcase can be seen
side-by-side.

Implements: #9 (`xfstestsdb show`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker a9a2c2bf7d testcase: Create the `xfstestsdb testcase show` command
This command shows detailed information about a specific testcase. The
'--maxlines=' option can be used to control the number of lines printed
from the system logs.

Implements: #13 (`xfstestsdb testcase show`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker 489c08e55c testcase: Create the `xfstestsdb testcase list` command
This command prints out information about the known testcases. It has
extra options to filter by runid, device, xunit, testcase, and status.

Implements: #11 (`xfstestsdb testcase list`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker 68a4b58a5a xfstestsdb: Add the `xfstestsdb testcase` subcommand
This subcomand doesn't actually do anything. It'll act as a hub for
testcase related subcommands instead.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:56 -05:00
Anna Schumaker 3366c1eb0c xfstestsdb: Add testcases from the xunit file to the database
I use the testcases table to store testcase information, and store
messages, system out, and system error logs in the messages table.

The testcases_view is used to link testcases with their source xunits,
messages, system out, and system error logs. This view has an INSTEAD
OF INSERT trigger to allow insertions that properly set up message ids
in the testcases table.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 16:15:55 -05:00
Anna Schumaker 84a7507998 xunit: Create the `xfstestsdb xunit properties` command
This command prints out (key, value) pairs for each xunit property in
the database. It has options to filter by runid, xunit name, property
name, and value.

Implements: #14 (`xfstestsdb xunit properties`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 14:22:32 -05:00
Anna Schumaker 29065d0f8f xfstestsdb: Add properties from the xunit file to the database
I use the xunit_properties table to store unique (key, value) pairs. The
link_xunit_properties table is then used to link properties to xunit
files.

I also make sure that properties are cleaned up when xunits are deleted,
but that we hang on to properties still in use by other xunits.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 14:22:32 -05:00
Anna Schumaker e27bc9f5ae xfstestsdb: Create the `xfstestsdb xunit list` command
This command prints out information about the known xunit files. It has
extra options for filtering by runid, device, name, and hostname. I also
gave it optional Timestamp and Results columns that the user can enable.

Implements: #12 (`xfstestsdb xunit list`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 14:22:32 -05:00
Anna Schumaker f4b77f527b xfstestsdb: Add an 'Xunit' column to the `xfstestsdb list` table
This is an optional column that can be enabled by passing "--xunit" as
an option. The "--xunit" option takes an optional string that can be
used to filter results by a specific xunit pattern.

Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
2023-02-16 14:22:32 -05:00