pytest-dev / pytest-dev/pytest-xdist
WindowsError: [Error 2] when trying to run test from windows 10 on a remote raspberrypi via ssh
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.9k
- Forks
- 287
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 2
Description
I am trying to run some pytest testcases on a remote raspberrypi via pytest-xdist ssh.
The localhost from which I want to run the tests has Windows 10 and the raspberrypi runs with Raspbian.
The tests use the standard pytest naming conventions an are located in a single file test_cases.py. This file also includes the code that is being tested. The folder named "test_cases" has a init.py like stated in the xdist documentation as well as the main-folder
"remotetest".
All test run fine when startet locally. So it seems to be no problem with the tests itself.
ssh connection to the raspberrypi is also working (I am using authentication-keys in order to not needing to enter a password everytime).
But if I try to run the tests via xdist ssh on the raspberrypi I always get the following error and can't really figure out the reason.
I use for example: pytest -d --tx ssh=pi@raspberrypi//python=python2.7 --rsyncdir test_cases
C:\remotetest>pytest -d --tx ssh=pi@raspberrypi//python=python2.7 --rsyncdir test_cases
============================= test session starts =============================
platform win32 -- Python 2.7.14, pytest-4.6.4, py-1.8.0, pluggy-0.12.0
rootdir: C:\remotetest
plugins: forked-1.1.3, xdist-1.31.0
gw0 IINTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "c:\python27\lib\site-packages\_pytest\main.py", line 204, in wrap_session
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\hooks.py", line 289, in __call__
INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\manager.py", line 81, in <lambda>
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\callers.py", line 81, in get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File "c:\python27\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "c:\python27\lib\site-packages\xdist\dsession.py", line 78, in pytest_sessionstart
INTERNALERROR> nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR> File "c:\python27\lib\site-packages\xdist\workermanage.py", line 64, in setup_nodes
INTERNALERROR> nodes.append(self.setup_node(spec, putevent))
INTERNALERROR> File "c:\python27\lib\site-packages\xdist\workermanage.py", line 68, in setup_node
INTERNALERROR> gw = self.group.makegateway(spec)
INTERNALERROR> File "c:\python27\lib\site-packages\execnet\multi.py", line 133, in makegateway
INTERNALERROR> io = gateway_io.create_io(spec, execmodel=self.execmodel)
INTERNALERROR> File "c:\python27\lib\site-packages\execnet\gateway_io.py", line 121, in create_io
INTERNALERROR> io = Popen2IOMaster(args, execmodel)
INTERNALERROR> File "c:\python27\lib\site-packages\execnet\gateway_io.py", line 21, in __init__
INTERNALERROR> self.popen = p = execmodel.PopenPiped(args)
INTERNALERROR> File "c:\python27\lib\site-packages\execnet\gateway_base.py", line 184, in PopenPiped
INTERNALERROR> return self.subprocess.Popen(args, stdout=PIPE, stdin=PIPE)
INTERNALERROR> File "c:\python27\lib\subprocess.py", line 390, in __init__
INTERNALERROR> errread, errwrite)
INTERNALERROR> File "c:\python27\lib\subprocess.py", line 640, in _execute_child
INTERNALERROR> startupinfo)
INTERNALERROR> WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden
I tried many variants like without specifying the python interpreter or running it directly from within the folder test_cases.
Now I am running out of ideas on what to try next or on what to search for. And wanted to ask if anybody can help me with this problem?
One thing I am currently thinking about:
Does pytest-xdist need rsync (the actual rsync like on Linux) on the localhost (I couldn't find anything in the documentation on this). And if so where can I get it for Windows 10?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the traceback in execnet/gateway_io.py, execnet/gateway_base.py, and subprocess.py, then reproduce the Windows command shown in the issue. Determine which executable or Windows-specific setup causes WindowsError [Error 2] during SSH gateway creation. Done means the remote pytest-xdist invocation works on Windows, or the required limitation and setup are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100