This module provides a representation of some result reporting
conventions for ResultsDB (the ones we've just invented in the
last two days, so far). It's a class-based design - currently
hierarchical, but I suspect mixins might become a thing - and
the idea is that you can subclass (or even just use directly)
the class that most closely reflects the situation you want to
report a result for, and you get a lot of 'standard' stuff -
commonly-reported extradata and group memberships, mostly -
handled for you. This saves us boilerplating stuff around
between reporters for systems that do similar tests (e.g.
openQA, Autocloud and relval for compose tests) and ensures
they all use the same conventions for extradata naming, group
identification etc.
It's pretty easy to use, try this:
import logging
logging.basicConfig(level=logging.DEBUG)
import resultsdb_conventions
res = resultsdb_conventions.ImageResult(
'Fedora-Rawhide-20170131.n.1', 'Fedora-Server-dvd-x86_64-Rawhide-20170131.n.1.iso', 'compose.some.test', 'PASSED', 'note here', 'https://www.test.case/', 'https://www.job.link/'
)
res.report(None)
The argument to report is the ResultsDBapi instance, if you
set it to None, no reporting is done (but the attributes of the
result are logged at DEBUG loglevel).
As a minor nitpick, we have this set to 99, in case you want to have the conventions synchronized between projects :-)