----- "James Laska" <jlaska(a)redhat.com> wrote:
I played around with a quick'n'dirty patch that uses the logging
module
(which autotest extends for us).
http://pastie.org/747317
It's definitely not perfect or something I would consider committing.
I
just was curious how the logging module would work with our test
wrappers. The nice thing is autotest splits the output based on
loglevel for us ...
# ls /usr/share/autotest/client/results/post-koji-build
\:rpmguard.x86_64/rpmguard/debug/
rpmguard.DEBUG rpmguard.ERROR rpmguard.INFO
rpmguard.WARNING
# cat /usr/share/autotest/client/results/post-koji-build
\:rpmguard.x86_64/rpmguard/debug/rpmguard.ERROR
rpmlint.noarch |
348
kB 00:00 ... ] 0.0 B/s | 53 kB --:-- ETA
12/17 11:15:16 ERROR| rpmguard:0124| added REQUIRES
libportaudio.so.2
removed REQUIRES libpulse.so.0
removed REQUIRES libpulse.so.0(PULSE_0)
12/17 11:15:24 ERROR| rpmguard:0124| added REQUIRES
libportaudio.so.2()(64bit)
removed REQUIRES libpulse.so.0()(64bit)
removed REQUIRES libpulse.so.0(PULSE_0)(64bit)
12/17 11:15:27 ERROR| rpmguard:0124| added REQUIRES
libportaudio.so.2()(64bit)
removed REQUIRES libpulse.so.0()(64bit)
removed REQUIRES libpulse.so.0(PULSE_0)(64bit)
12/17 11:15:34 ERROR| rpmguard:0124| added REQUIRES
libportaudio.so.2
removed REQUIRES libpulse.so.0
removed REQUIRES libpulse.so.0(PULSE_0)
The format of the logs is something autotest has defined, and we can
override if desired. Also, in this example I was assuming that any
output from rpmguard was considered a failure. So that output was
sent
using logging.error(...).
The logging module is pretty flexible. It's easy to add additional
logging destinations (files, stdout etc...), each with their own
output
formats. So we could continue creating the single rpmguard.log
results
file if desired. In fact, we could possible have this done for every
test by providing an AutoQA specific output handler in addition to
what
autotest has defined.
Thoughts/comments/concerns?
I would like to use it, even though I still see value in having self.results
separated from general logging facility (but it all depends how we want our
output to look like). I will play with it after Christmas.