allow jobs to leave outcome info for auto-resume resolution
Previously when checkbox was auto-resumed (e.g. when running reboot stress
jobs), the outcome was always decided to be passed.
This patch introduces a way for jobs to communicate back what the outcome
should be. This way if a job detects a problem with a job, it can leave
appropriate message in the CHECKBOX_DATA dir.
The feedback file that checkbox looks for is __result. It should be a json
object containing fields that will be used by MemoryJobResult, most important
of which is the "outcome". Other useful field is "comments" so the job can
give verbose information about what went wrong.
If the file cannot be parsed, or the file isn't there checkbox defaults to the
previous behavior of marking as passed.
Signed-off-by: Maciej Kisielewski <email address hidden>
fix and improve `list all-jobs` and `list-bootstrapped` subcmds
fix: checkbox no longer backtraces on missing field (my previous implementation
of the default values for the .format() was dumb and broken.
improvements:
- there is a consistent naming of fields in units, previously it was tr_summary
when running all-jobs and _summary when running list-bootstrapped.
Now it uses same nomenclature as pxu file (i.e. _summary)
- you can now print 'id' or 'full_id'. The former being the unqualified name
- when asking to print available fields via `--format ?` the list is now sorted
- tidy-up the look of `--format ?` printout
Signed-off-by: Maciej Kisielewski <email address hidden>
fix crash when resuming a session started with checkbox-cli run
Sessions started with checkbox-cli run (...) had their app_blob uninitiated.
Which in turn got marshalled into an empty string... When the session manager
tried to parse JSON inside the unmarshalled session file, it crashed because
of the missing root object.
This patch makes `run` properly initiate app_blob object.
Signed-off-by: Maciej Kisielewski <email address hidden>