On Tue, 2010-07-13 at 15:53 +0200, Vojtěch Aschenbrenner wrote:
Hello,
I created new test for AutoQA named 'helloworld', ticket #195. It's
simple test, that will only forward parameters that were passed in
control file. Main purpose is to show, how to write new tests for
AutoQA. Patch included.
Awesome! This is almost exactly what I was hoping for - with a couple
comments below.
+# post-koji-build tests can expect the following variables from
autoqa:
+# envr: package NVR (required, epoch can be skipped)
+# name: package name
+# kojitag: koji tag applied to this package
+
+job.run_test('helloworld', name=name, envr=envr, kojitag=kojitag,
config=autoqa_conf)
This will work for the post-koji-build hook, but we want to be able to
run this test under any hook (partially in order to test the hooks). So
probably we want to run the test with the result of locals(), something
like:
job.run_test('helloworld', config=autoqa_conf, **locals())
(doing **locals() passes the contents of locals as if they had all been
given to the function as "var_name=var_value" pairs)
+ def initialize(self, envr, config):
If we aren't using envr here, no need to require it:
def initialize(self, config):
should work fine.
+ def run_once(self, **kwargs):
Probably we want *args as well as **kwargs here, just in case.
So, if those changes seem reasonable, just send along a new version of
the patch and I'd be happy to merge it into master.
Thanks so much!
-w