~bryce/ubuntu-helpers:add-trigger-class

Last commit made on 2022-07-14
Get this branch:
git clone -b add-trigger-class https://git.launchpad.net/~bryce/ubuntu-helpers
Only Bryce Harrington can upload to this branch. If you are Bryce Harrington please log in for upload directions.

Branch merges

Branch information

Name:
add-trigger-class
Repository:
lp:~bryce/ubuntu-helpers

Recent commits

b8b8182... by Bryce Harrington

lp-test-ppa: Add Trigger class

For now this class simply holds data elements and formats them into
strings and urls.

get_triggers() is just a wrapper around the triggers property that
provides the data as Trigger objects. But this gives an api more
consistent with get_subtests().

a65400b... by Bryce Harrington

lp-test-ppa: Simplify regex for triggers

Use regex group to extract the triggers. Limit our search to just the
first portion of the log (as demarked by @@@@@@).

Also, this introduces a fledgling test case. Nothing fancy yet, just
enough to exercise the code to verify it works with a few different
intensities of autopkgtest logs.

08d4655... by Bryce Harrington

lp-test-ppa: Improve overall status reporting

This fixes a bug where the overall_status was being reset for each
subtest, so really was only accurate about the final subtest's status.

A secondary bug tracking overall_status could crop up if using --subtest
to limit the display of results; this would cause overall_status to miss
failures of non-displayed subtests.

We now track the overall status in Result.status by iterating over all
subtests, separately from the subtest display.

Further, this splits (overall) status and status_icon for Result
objects, like done for Subtests. Status of Subtest and Result objects
are distinguished design-wise by using solid buttons for the former, and
colorful symbols for the latter. Both use the same symbol to indicate
error conditions, to avoid ambiguity that something's broken.

b54c104... by Bryce Harrington

lp-test-ppa: Refactor a Results.subtests() property

Introduce a Subtest class for encapsulating per-subtest status
information. Primarily, this is used to parse the status from the
subtest's result line, and to give a colorful status icon.

Previously, the unicode icon was used as the status value itself, but
this uses a textual string ('PASS', 'FAIL', et al) that will be easier
to use in code.

f1952de... by Bryce Harrington

lp-test-ppa: Refactor a Result.triggers() property

Code for parsing triggers from the test results log is refactored out to
become a new property for the Results class. The parse results are
cached so that this can be called multiple times without
reparsing/reformatting the data.

8202349... by Bryce Harrington

lp-test-ppa: Refactor a Result.log() property

Move the code to download the log file into its own property member
inside the Result class. This caches the downloaded results, so that
multiple calls don't re-download the data.

Also adds a Result.status property, which for now just stores download
errors, but will also be used for storing the overall pass/fail state
for the test.

19a4035... by Bryce Harrington

lp-test-ppa: Refactor a Result.timestamp() property

Member function to format the result's time as a str timestamp.

7b938ce... by Bryce Harrington

lp-test-ppa: Rename getLink() to ansi_hyperlink()

For clarity to emphasize this is formatting an ANSI hyperlink.

It appears the end param to this routine is not actually used in the
formatting, so drop its use.

6e22ed0... by Bryce Harrington

lp-test-ppa: Store Result objects in result_data array

result_data remains keyed by a source, arch tuple, but now contains
actual Result objects rather than a tuple of elements.

c15773e... by Christian Ehrhardt 

pkg_per_release.sh: trivial helper to get PKG counts per release/component

Signed-off-by: Christian Ehrhardt <email address hidden>