[svn r63157] remove old events, some more renamings
--HG-- branch : trunk
This commit is contained in:
parent
f157a5d697
commit
69e68bed29
|
@ -4,41 +4,6 @@ from py.__.test.dsession.masterslave import MasterNode
|
||||||
from py.__.execnet.gwmanage import GatewayManager
|
from py.__.execnet.gwmanage import GatewayManager
|
||||||
from py.__.test import event
|
from py.__.test import event
|
||||||
|
|
||||||
def getxspecs(config):
|
|
||||||
if config.option.numprocesses:
|
|
||||||
if config.option.executable:
|
|
||||||
s = 'popen//python=%s' % config.option.executable
|
|
||||||
else:
|
|
||||||
s = 'popen'
|
|
||||||
xspecs = [s] * config.option.numprocesses
|
|
||||||
else:
|
|
||||||
xspecs = config.option.xspecs
|
|
||||||
if not xspecs:
|
|
||||||
xspecs = config.getvalue("xspecs")
|
|
||||||
assert xspecs is not None
|
|
||||||
#print "option value for xspecs", xspecs
|
|
||||||
return [py.execnet.XSpec(x) for x in xspecs]
|
|
||||||
|
|
||||||
def getconfigroots(config):
|
|
||||||
roots = config.option.rsyncdirs
|
|
||||||
if roots:
|
|
||||||
roots = [py.path.local(x) for x in roots.split(',')]
|
|
||||||
else:
|
|
||||||
roots = []
|
|
||||||
conftestroots = config.getconftest_pathlist("rsyncdirs")
|
|
||||||
if conftestroots:
|
|
||||||
roots.extend(conftestroots)
|
|
||||||
pydir = py.path.local(py.__file__).dirpath()
|
|
||||||
for root in roots:
|
|
||||||
if not root.check():
|
|
||||||
raise ValueError("rsyncdir doesn't exist: %r" %(root,))
|
|
||||||
if pydir is not None and root.basename == "py":
|
|
||||||
if root != pydir:
|
|
||||||
raise ValueError("root %r conflicts with current %r" %(root, pydir))
|
|
||||||
pydir = None
|
|
||||||
if pydir is not None:
|
|
||||||
roots.append(pydir)
|
|
||||||
return roots
|
|
||||||
|
|
||||||
class NodeManager(object):
|
class NodeManager(object):
|
||||||
def __init__(self, config, specs=None):
|
def __init__(self, config, specs=None):
|
||||||
|
@ -94,7 +59,7 @@ class NodeManager(object):
|
||||||
self.gwmanager.rsync(self.config.topdir, **options)
|
self.gwmanager.rsync(self.config.topdir, **options)
|
||||||
# and cd into it
|
# and cd into it
|
||||||
self.gwmanager.multi_chdir(self.config.topdir.basename, inplacelocal=False)
|
self.gwmanager.multi_chdir(self.config.topdir.basename, inplacelocal=False)
|
||||||
self.config.bus.notify("rsyncfinished", event.RsyncFinished())
|
self.config.bus.notify("rsyncfinished")
|
||||||
|
|
||||||
def trace(self, msg):
|
def trace(self, msg):
|
||||||
self.config.bus.notify("trace", "nodemanage", msg)
|
self.config.bus.notify("trace", "nodemanage", msg)
|
||||||
|
@ -123,3 +88,39 @@ class NodeManager(object):
|
||||||
def teardown_nodes(self):
|
def teardown_nodes(self):
|
||||||
# XXX teardown nodes?
|
# XXX teardown nodes?
|
||||||
self.gwmanager.exit()
|
self.gwmanager.exit()
|
||||||
|
|
||||||
|
def getxspecs(config):
|
||||||
|
if config.option.numprocesses:
|
||||||
|
if config.option.executable:
|
||||||
|
s = 'popen//python=%s' % config.option.executable
|
||||||
|
else:
|
||||||
|
s = 'popen'
|
||||||
|
xspecs = [s] * config.option.numprocesses
|
||||||
|
else:
|
||||||
|
xspecs = config.option.xspecs
|
||||||
|
if not xspecs:
|
||||||
|
xspecs = config.getvalue("xspecs")
|
||||||
|
assert xspecs is not None
|
||||||
|
#print "option value for xspecs", xspecs
|
||||||
|
return [py.execnet.XSpec(x) for x in xspecs]
|
||||||
|
|
||||||
|
def getconfigroots(config):
|
||||||
|
roots = config.option.rsyncdirs
|
||||||
|
if roots:
|
||||||
|
roots = [py.path.local(x) for x in roots.split(',')]
|
||||||
|
else:
|
||||||
|
roots = []
|
||||||
|
conftestroots = config.getconftest_pathlist("rsyncdirs")
|
||||||
|
if conftestroots:
|
||||||
|
roots.extend(conftestroots)
|
||||||
|
pydir = py.path.local(py.__file__).dirpath()
|
||||||
|
for root in roots:
|
||||||
|
if not root.check():
|
||||||
|
raise ValueError("rsyncdir doesn't exist: %r" %(root,))
|
||||||
|
if pydir is not None and root.basename == "py":
|
||||||
|
if root != pydir:
|
||||||
|
raise ValueError("root %r conflicts with current %r" %(root, pydir))
|
||||||
|
pydir = None
|
||||||
|
if pydir is not None:
|
||||||
|
roots.append(pydir)
|
||||||
|
return roots
|
||||||
|
|
|
@ -89,6 +89,6 @@ class TestAsyncFunctional:
|
||||||
assert os.nice(0) == 10
|
assert os.nice(0) == 10
|
||||||
""")
|
""")
|
||||||
evrec = testdir.inline_run('-d', p1, '--tx=popen')
|
evrec = testdir.inline_run('-d', p1, '--tx=popen')
|
||||||
ev = evrec.getreport('test_nice')
|
ev = evrec.getfirstnamed('itemtestreport')
|
||||||
assert ev.passed
|
assert ev.passed
|
||||||
|
|
||||||
|
|
|
@ -157,16 +157,11 @@ class HostRSyncing(BaseEvent):
|
||||||
self.remotepath = remotepath
|
self.remotepath = remotepath
|
||||||
self.synced = synced
|
self.synced = synced
|
||||||
|
|
||||||
class RsyncFinished(BaseEvent):
|
|
||||||
def __init__(self):
|
|
||||||
self.time = timestamp()
|
|
||||||
|
|
||||||
class HostRSyncRootReady(BaseEvent):
|
class HostRSyncRootReady(BaseEvent):
|
||||||
def __init__(self, host, root):
|
def __init__(self, host, root):
|
||||||
self.host = host
|
self.host = host
|
||||||
self.root = root
|
self.root = root
|
||||||
|
|
||||||
|
|
||||||
# make all eventclasses available on BaseEvent so that
|
# make all eventclasses available on BaseEvent so that
|
||||||
# consumers of events can easily filter by
|
# consumers of events can easily filter by
|
||||||
# 'isinstance(event, event.Name)' checks
|
# 'isinstance(event, event.Name)' checks
|
||||||
|
|
|
@ -258,11 +258,6 @@ class TerminalReporter:
|
||||||
else:
|
else:
|
||||||
excrepr.reprcrash.toterminal(self._tw)
|
excrepr.reprcrash.toterminal(self._tw)
|
||||||
|
|
||||||
def out_hostinfo(self):
|
|
||||||
self._tw.line("host 0: %s %s - Python %s" %
|
|
||||||
(py.std.sys.platform,
|
|
||||||
py.std.sys.executable,
|
|
||||||
repr_pythonversion()))
|
|
||||||
|
|
||||||
class CollectonlyReporter:
|
class CollectonlyReporter:
|
||||||
INDENT = " "
|
INDENT = " "
|
||||||
|
|
|
@ -240,7 +240,6 @@ class TestConfigApi_getcolitems:
|
||||||
|
|
||||||
class TestOptionEffects:
|
class TestOptionEffects:
|
||||||
def test_boxed_option_default(self, testdir):
|
def test_boxed_option_default(self, testdir):
|
||||||
testdir.makepyfile(conftest="dist_hosts=[]")
|
|
||||||
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
|
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
|
||||||
config = py.test.config._reparse([tmpdir])
|
config = py.test.config._reparse([tmpdir])
|
||||||
config.initsession()
|
config.initsession()
|
||||||
|
@ -254,10 +253,8 @@ class TestOptionEffects:
|
||||||
assert not config.option.boxed
|
assert not config.option.boxed
|
||||||
|
|
||||||
def test_boxed_option_from_conftest(self, testdir):
|
def test_boxed_option_from_conftest(self, testdir):
|
||||||
testdir.makepyfile(conftest="dist_hosts=[]")
|
|
||||||
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
|
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
|
||||||
tmpdir.join("conftest.py").write(py.code.Source("""
|
tmpdir.join("conftest.py").write(py.code.Source("""
|
||||||
dist_hosts = []
|
|
||||||
dist_boxed = True
|
dist_boxed = True
|
||||||
"""))
|
"""))
|
||||||
config = py.test.config._reparse(['--dist', tmpdir])
|
config = py.test.config._reparse(['--dist', tmpdir])
|
||||||
|
|
Loading…
Reference in New Issue