#200: Multiple control files / multiple test wrappers --------------------+------------------------------------------------------- Reporter: wwoods | Owner: Type: task | Status: new Priority: major | Milestone: Multi-hook tests Component: tests | Version: 1.0 Keywords: | --------------------+------------------------------------------------------- For a test to run under multiple hooks, it may need multiple control files, since we may want to do slightly different things to prepare for each test. We could have multiple test wrappers and conditionalize the job.run_test() argument based on the calling hook, for example:
if hook == 'post-koji-build': job.run_test('mytest_koji', name=name, envrs=envrs, ...) elif hook == 'post-bodhi-update': job.run_test('mytest_bodhi', name=name, envrs=envrs, ...)
Alternately, we could have multiple control.HOOKNAME files - one for each hook the test can be run under. This would also allow us to eliminate the use of the 'testlist' file to determine the tests that are eligible for use in each hook - each test would be able to declare how to run itself under each hook.
This ticket requires deciding on a method for handling multi-hook tests, documenting that method, and (perhaps) converting existing tests.
#200: Multiple control files / multiple test wrappers ---------------------+------------------------------------------------------ Reporter: wwoods | Owner: Type: task | Status: new Priority: major | Milestone: Multi-hook tests Component: tests | Version: 1.0 Resolution: | Keywords: ---------------------+------------------------------------------------------ Comment (by jskladan):
Just some quick thoughts: the problem i see with multiple control.HOOKNAME files is that once we'll need to do a change in the control file, we'll need to edit _many_ files, which is IMHO not such a good idea. So from my point of view conditionalized job.run_test() is better.
I guess, that the tests then would implement (possibly) several "run_once_HOOKNAME" functions, and "run_once" would be merely a dispatcher calling the right one (based on the HOOKNAME argument) - or at least this could be the default implementation in the base test class i'm currently trying to push so the changes in the tests currently written would be only changing the run_once function name.
#200: Multiple control files / multiple test wrappers ---------------------+------------------------------------------------------ Reporter: wwoods | Owner: Type: task | Status: closed Priority: major | Milestone: Multi-hook tests Component: tests | Version: 1.0 Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by kparal):
* status: new => closed * resolution: => fixed
Comment:
I believe this has been solved by my control.autoqa patchset: http://git.fedorahosted.org/git/?p=autoqa.git;a=commit;h=d7f91c3e89f173b1b92...
We can now use control.autoqa file to schedule a test for multiple hooks.
The documentation is done inside template files. The documentation on the wiki is not updated yet, but we will need to update it anyway because of many other changes that happened there, so I'm closing this ticket.
autoqa-devel@lists.fedorahosted.org