python-remote-pdb icon indicating copy to clipboard operation
python-remote-pdb copied to clipboard

Add unixsocket support

Open heroesm opened this issue 5 years ago • 6 comments

use case:

>>> import remote_pdb as rpdb
>>> rpdb.set_trace('./t.sock')
>>> rpdb.set_trace('t.sock', unixsocket=True)
>>> rpdb.set_trace(unixsocket='t.sock')

invalid:

>>> import remote_pdb as rpdb
>>> rpdb.set_trace('t.sock')
socket.gaierror: [Errno -2] Name or service not known

heroesm avatar Sep 21 '20 07:09 heroesm

Hey, thanks for taking #20 over. I wonder if we could avoid set_trace(None, unixsocket='t.sock') and allow set_trace(unixsocket='t.sock') (have host='127.0.0.1' as default).

ionelmc avatar Sep 21 '20 08:09 ionelmc

@ionelmc fixed

heroesm avatar Sep 21 '20 08:09 heroesm

Any feedback?

heroesm avatar Sep 26 '20 05:09 heroesm

Looks good. Would you be so kind to also take a look at the tests?

ionelmc avatar Sep 26 '20 07:09 ionelmc

@ionelmc I've tried, but the test tool process_tests is not familiar to me.

I cannot even pass the simple test case in my local environment, even in the master branch:

$ pytest tests/test_remote_pdb.py::test_simple
==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.8.0, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/m/git/python-remote-pdb, configfile: setup.cfg
plugins: travis-fold-1.3.0
collected 1 item                                                                                                                                                                             

tests/test_remote_pdb.py F                                                                                                                                                             [100%]

========================================================================================== FAILURES ==========================================================================================
________________________________________________________________________________________ test_simple _________________________________________________________________________________________
tests/test_remote_pdb.py:25: in test_simple
    wait_for_strings(proc.read, TIMEOUT,
../../.pyenv/versions/3.8.0/envs/py38env/lib/python3.8/site-packages/process_tests.py:246: in wait_for_strings
    raise AssertionError("Waited %0.2fsecs but %s did not appear in output in the given order !" % (
E   AssertionError: Waited 10.00secs but ['RemotePdb session open at ', '{b1}', '{a1}'] did not appear in output in the given order !
------------------------------------------------------------------------------------ Captured stdout call ------------------------------------------------------------------------------------
*********** OUTPUT ***********
413062 10/09/20~03:34:22,00867 remote_pdb CRITICAL RemotePdb session open at 127.0.0.1:42597, waiting for connection ...
RemotePdb session open at 127.0.0.1:42597, waiting for connection ...

******************************
================================================================================== short test summary info ===================================================================================
FAILED tests/test_remote_pdb.py::test_simple - AssertionError: Waited 10.00secs but ['RemotePdb session open at ', '{b1}', '{a1}'] did not appear in output in the given order !
===================================================================================== 1 failed in 11.33s =====================================================================================

BTW, should process_tests and other test requirements be declared in setup.py?

heroesm avatar Oct 08 '20 19:10 heroesm

Tests are to be run with tox. Not sure what's going on in your example there, perhaps push the test you have?

ionelmc avatar Nov 02 '20 06:11 ionelmc