bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

Fix debugger output parsing in attach command #490

Closed pablogsal closed 10 months ago

pablogsal commented 10 months ago

When using lldb in macOS, the output of lldb is slighly different and we are not properly matching that is what we expect. To avoid having to rely on weird hacks to not detect the actual command we issue, filter the output to not contain the lines that have the debugger promt to only check against the actual debugger output. This simplifies the check and provides an easier way to do assert that we are in the situation we expect.

Issue number of the reported bug or feature request: #

Describe your changes A clear and concise description of the changes you have made.

Testing performed Describe the testing you have performed to ensure that the bug has been addressed, or that the new feature works as planned.

Additional context Add any other context about your contribution here.

codecov-commenter commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (27c1f73) 92.29% compared to head (394697f) 92.12%. Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #490 +/- ## ========================================== - Coverage 92.29% 92.12% -0.17% ========================================== Files 91 91 Lines 10849 10850 +1 Branches 1498 1499 +1 ========================================== - Hits 10013 9996 -17 - Misses 834 851 +17 - Partials 2 3 +1 ``` | [Flag](https://app.codecov.io/gh/bloomberg/memray/pull/490/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/bloomberg/memray/pull/490/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | `85.60% <ø> (-0.50%)` | :arrow_down: | | [python_and_cython](https://app.codecov.io/gh/bloomberg/memray/pull/490/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | `95.44% <50.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/bloomberg/memray/pull/490?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg) | Coverage Δ | | |---|---|---| | [src/memray/commands/attach.py](https://app.codecov.io/gh/bloomberg/memray/pull/490?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg#diff-c3JjL21lbXJheS9jb21tYW5kcy9hdHRhY2gucHk=) | `64.50% <50.00%> (+0.17%)` | :arrow_up: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/bloomberg/memray/pull/490/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bloomberg)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.