Re: [py-dev] xdist and pytest.main
On Sun, Aug 05, 2012 at 17:31 -0400, Adam Goucher wrote: > Whoops. Didn't look at the list reply-to settings so pulling the list > back in. This does seem to be the cause. I commented out the > sys.path.append in the wrapper and added > > def pytest_configure(config): > sys.path.append(os.path.join(os.getcwd(), "modules")) > > to the conftest.py in the root and it 'seems' to be working. > > My initial thoughts around error detection still stands though. Your passing of --debug is also what i would have tried. One can also enable EXECNET debugging, see http://codespeak.net/execnet/basics.html#debugging-execnet This gives a lot of low-level network messages but is sometimes helpful. best, holger > Thanks for the nudge to finding the solution. > > -adam > > A little more debugging (including the --debug flag) has led me to > > something I believe... > > > > For context my wrapper runs from a prescribed directory structure > > shown at > > https://github.com/Element-34/Py.Saunter-Examples/tree/master/ebay > > (for example). And part of that wrapper is a modification to the > > system path as such > > > > sys.path.append(os.path.join(cwd, "modules")) > > > > What I am now guessing is that the environment does not get forked > > into the slave processes as alluded to in this message. > > > > [slave-gw1] sending collectreport {'data': {'longrepr': > > 'scripts/DressShirts.py:15: in \n> from > > saunter.testcase.webdriver import > > SaunterTestCase\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytest-2.2.4-py2.7.egg/_pytest/assertion/rewrite.py:156: > > > > in load_module\n> py.builtin.exec_(co, > > mod.__dict__)\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py.saunter-0.48-py2.7.egg/saunter/testcase/webdriver.py:34: > > > > in \n> from tailored.webdriver import WebDriver\nE > > ImportError: No module named tailored.webdriver', 'outcome': 'failed', > > 'sections': [], 'result': None, 'nodeid': 'scripts/DressShirts.py'}} > > > > If that is the case [and I have to go fix my sister's email else I > > would debug it further] > > > > a) how do I pass that environment change to my forked processes > > (guessing just move that to conftest.py?) > > b) if there is an exception thrown in the collection process on a > > slave, it likely should bubble up to the user > > > > -adam > >> Hum, this looks like no tests are collected at all. If you leave > >> away the "-n" option, tests do run? Can you show the -v output of > >> that? I assume you are running things in the correct directory > >> and have no change-directory code in your tests/plugin? > >> > >> best, > >> holger > >> > > > > ___ > py-dev mailing list > py-dev@codespeak.net > http://codespeak.net/mailman/listinfo/py-dev > ___ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev
Re: [py-dev] xdist and pytest.main
Whoops. Didn't look at the list reply-to settings so pulling the list back in. This does seem to be the cause. I commented out the sys.path.append in the wrapper and added def pytest_configure(config): sys.path.append(os.path.join(os.getcwd(), "modules")) to the conftest.py in the root and it 'seems' to be working. My initial thoughts around error detection still stands though. Thanks for the nudge to finding the solution. -adam > A little more debugging (including the --debug flag) has led me to > something I believe... > > For context my wrapper runs from a prescribed directory structure > shown at > https://github.com/Element-34/Py.Saunter-Examples/tree/master/ebay > (for example). And part of that wrapper is a modification to the > system path as such > > sys.path.append(os.path.join(cwd, "modules")) > > What I am now guessing is that the environment does not get forked > into the slave processes as alluded to in this message. > > [slave-gw1] sending collectreport {'data': {'longrepr': > 'scripts/DressShirts.py:15: in \n> from > saunter.testcase.webdriver import > SaunterTestCase\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytest-2.2.4-py2.7.egg/_pytest/assertion/rewrite.py:156: > > in load_module\n> py.builtin.exec_(co, > mod.__dict__)\n/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py.saunter-0.48-py2.7.egg/saunter/testcase/webdriver.py:34: > > in \n> from tailored.webdriver import WebDriver\nE > ImportError: No module named tailored.webdriver', 'outcome': 'failed', > 'sections': [], 'result': None, 'nodeid': 'scripts/DressShirts.py'}} > > If that is the case [and I have to go fix my sister's email else I > would debug it further] > > a) how do I pass that environment change to my forked processes > (guessing just move that to conftest.py?) > b) if there is an exception thrown in the collection process on a > slave, it likely should bubble up to the user > > -adam >> Hum, this looks like no tests are collected at all. If you leave >> away the "-n" option, tests do run? Can you show the -v output of >> that? I assume you are running things in the correct directory >> and have no change-directory code in your tests/plugin? >> >> best, >> holger >> > ___ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev
Re: [py-dev] xdist and pytest.main
Hi Adam, On Thu, Aug 02, 2012 at 14:49 -0400, Adam Goucher wrote: > I have a WebDriver framework that wraps Py.Test and after a bunch of > setup stuff calls into things with > > run_status = pytest.main(args=arguments, plugins=[marks.MarksDecorator()]) > > which works fine for a single execution. But now I've got a couple > clients that /really/ want parallel execution. My thinking for this > would be to add in the necessary arguments to pass in the way all the > other arguments have been... > > if 'n' in results.__dict__ and results.__dict__['n'] != None: > arguments.append("--dist=load") > arguments.append("--tx=%s*popen" % results.__dict__['n']) > > But my scripts are not actually executing. (Which shouldnt be too too > surprising since I likely wouldnt be writing an email if they were...) > > Adam-Gouchers-MacBook:ebay adam$ pysaunter.py -m shirts -n 2 > > test session starts > = > platform darwin -- Python 2.7.2 -- pytest-2.2.4 > gw0 [0] / gw1 [0] > scheduling tests via LoadScheduling > > - generated xml file: > /Users/adam/work/saunter/py.saunter-examples/ebay/logs/2012-08-02-14-21-46.xml > > - > == > in 1.21 seconds > == > Adam-Gouchers-MacBook:ebay adam$ > > Any suggestions on how to debug why the workers are being created but > the scripts not executed? I'd like to not write my own xdist style > plugin so would like to make things behave with the existing one. Hum, this looks like no tests are collected at all. If you leave away the "-n" option, tests do run? Can you show the -v output of that? I assume you are running things in the correct directory and have no change-directory code in your tests/plugin? best, holger > -adam > > > ___ > py-dev mailing list > py-dev@codespeak.net > http://codespeak.net/mailman/listinfo/py-dev > ___ py-dev mailing list py-dev@codespeak.net http://codespeak.net/mailman/listinfo/py-dev