Add env variables to identify workers

This commit is contained in:
Bruno Oliveira
2016-08-04 20:50:54 -03:00
parent 1c7eb24a1f
commit d498cb3e0f
4 changed files with 34 additions and 2 deletions

View File

@@ -148,6 +148,8 @@ if __name__ == '__channelexec__':
os.environ['PYTHONPATH'] = (
importpath + os.pathsep +
os.environ.get('PYTHONPATH', ''))
os.environ['PYTEST_XDIST_WORKER'] = slaveinput['slaveid']
os.environ['PYTEST_XDIST_WORKER_COUNT'] = str(slaveinput['slavecount'])
# os.environ['PYTHONPATH'] = importpath
import py
config = remote_initconfig(option_dict, args)

View File

@@ -205,7 +205,8 @@ class SlaveController(object):
self.putevent = putevent
self.gateway = gateway
self.config = config
self.slaveinput = {'slaveid': gateway.id}
self.slaveinput = {'slaveid': gateway.id,
'slavecount': len(nodemanager.specs)}
self._down = False
self._shutdown_sent = False
self.log = py.log.Producer("slavectl-%s" % gateway.id)