more refined testerworker stucture
This commit is contained in:
parent
d34893a479
commit
f3c26d9ae8
@ -18,20 +18,35 @@ import sys
|
|||||||
import errno
|
import errno
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
from refstack.app import app
|
||||||
from refstack.common.tempest_config import TempestConfig
|
from refstack.common.tempest_config import TempestConfig
|
||||||
import testrepository.repository.file
|
import testrepository.repository.file
|
||||||
from testrepository import ui
|
from testrepository import ui
|
||||||
#from testrepository.commands import run
|
#from testrepository.commands import run
|
||||||
from testrepository.commands import init
|
from testrepository.commands import init
|
||||||
from fabric.api import run
|
|
||||||
import gear
|
import gear
|
||||||
|
|
||||||
class TesterWorker(object):
|
class TesterWorker(object):
|
||||||
"""gearman worker code"""
|
"""gearman worker code"""
|
||||||
def __init__(self):
|
def __init__(self,app):
|
||||||
#self.worker = gear.Worker('remote_test')
|
self.worker = gear.Worker('run_remote_test')
|
||||||
|
|
||||||
|
self.worker.addServer(app.gearman_server)
|
||||||
|
self.worker.registerFunction('run_remote_test')
|
||||||
|
|
||||||
|
|
||||||
|
def run_remote_test(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def run_job(self):
|
||||||
|
while True:
|
||||||
|
job = self.worker.getJob()
|
||||||
|
job.sendWorkComplete(job.arguments.reverse())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestRepositoryUI(ui.AbstractUI):
|
class TestRepositoryUI(ui.AbstractUI):
|
||||||
"""nothing"""
|
"""nothing"""
|
||||||
def __init__(self, here):
|
def __init__(self, here):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user