Skip to content

Add unixsocket support#27

Open
heroesm wants to merge 3 commits into
ionelmc:masterfrom
heroesm:feature/unixsocket
Open

Add unixsocket support#27
heroesm wants to merge 3 commits into
ionelmc:masterfrom
heroesm:feature/unixsocket

Conversation

@heroesm
Copy link
Copy Markdown

@heroesm heroesm commented Sep 21, 2020

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

@ionelmc
Copy link
Copy Markdown
Owner

ionelmc commented Sep 21, 2020

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).

@heroesm
Copy link
Copy Markdown
Author

heroesm commented Sep 21, 2020

@ionelmc fixed

@heroesm
Copy link
Copy Markdown
Author

heroesm commented Sep 26, 2020

Any feedback?

@ionelmc
Copy link
Copy Markdown
Owner

ionelmc commented Sep 26, 2020

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

@heroesm
Copy link
Copy Markdown
Author

heroesm commented Oct 8, 2020

@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?

@ionelmc
Copy link
Copy Markdown
Owner

ionelmc commented Nov 2, 2020

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 35.29412% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.95%. Comparing base (07d5633) to head (a784321).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/remote_pdb.py 35.29% 20 Missing and 2 partials ⚠️

❗ There is a different number of reports uploaded between BASE (07d5633) and HEAD (a784321). Click for more details.

HEAD has 29 uploads less than BASE
Flag BASE (07d5633) HEAD (a784321)
62 33
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #27      +/-   ##
==========================================
- Coverage   84.25%   76.95%   -7.31%     
==========================================
  Files           2        2              
  Lines         216      243      +27     
  Branches       27       31       +4     
==========================================
+ Hits          182      187       +5     
- Misses         26       46      +20     
- Partials        8       10       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants