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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This command is used to delete individual xunit entries attached to a
specific xfstests run.
Implements: #5 (`xfstestsdb xunit delete`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This command renames an xunit file associated with an xfstests run.
Implement: #4 (`xfstestsdb xunit rename`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This command reads an xunit file generated by passing "-R xunit" to
xfstests `./check`. Multiple xunit files can be added to a single
xfstests run, and will be shown side-by-side in columns when printed
out.
Implements: #3 (`xfstestsdb xunit read`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This subcommand doesn't actually do anything, it'll act as a hub for
xunit related subcommands instead.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This uses the Table class to print out a list of xfstests runs in a
table. It supports '--device=', '--tags=', and '--timestamp=' options
that can be used to generate a SQLite GLOB expression to filter the
list of results.
Implements: #10 (`xfstestsdb list`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This class is designed to make it easy to print out data formatted as a
table. It was inspired by the prettytable Python module but is tailored
for how I intend to use it, including support for color schemes.
I use two different character sets for drawing borders. If color is
disabled, then I use basic ascii "+" and "-" characters. However, if
colors are enabled then I use characters from the Unicode Box Drawing
block to draw a table with rounded corners.
Finally, each table cell is formatted by calling the "do_format_cell()"
function. Table subclasses can override this function to implement their
own coloring schemes.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This will be used by tools to print out text with colored outut. I
provide 3 options:
* A NoneScheme for printing text without any formatting
* A DarkScheme with colors chosen for a dark terminal
* A LightScheme with colors chosen for a light terminal
Users can set the XFSTESTSDB_COLORS environment variable to either
"none", "dark", or "light". If this environment variable isn't set, or
if it is set to an invalid value, then xfstestsdb will use dark mode by
default.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This command deletes a row from the xfstests_runs table and prints
either a success or failure message depending on if the row exists.
I use an sqlite trigger to automatically remove tags for the matching run.
Implements: #2 (`xfstestsdb delete`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This is the opposite of `xfstestsdb tag`, and removes a tag from an
xfstests run.
Implements: #7 (`xfstestsdb untag`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This command renames the device in an xfstests_runs database row.
Implements: #8 (`xfstestsdb rename`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
This command inserts a new row into the xfstests_runs table and prints
out the result.
Note that sqlite stores timestamps as UTC, so I use the datetime()
function to convert to localtime when returning the new row.
Implements: #1 (`xfstestsdb new`)
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>
The connection manager is used to initialize the database and has a
wrapper around the sqlite3.execute() and sqlite3.executemany() functions
for easier argument passing.
Additionally, it implements __enter__() and __exit__() functions to
manually begin a transaction to calls can use the sqlite3 "RETURNING"
clause.
Signed-off-by: Anna Schumaker <anna@nowheycreamery.com>