If no tests are running or have been completed in the past we
yield an error. That seems wrong, catch this case and just report
without an error state that we have not found running/past tests.
Signed-off-by: Christian Ehrhardt <email address hidden>
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.
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.
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.
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.