forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test DebugAdapter requests, and fix issues (pantsbuild#17678)
Fixes pantsbuild#17672 and fixes pantsbuild#17692 Added new test-code which tests the `DebugAdapterRequest` by running it without `--wait-for-client`. This wouldn't catch issues like pantsbuild#17540 which require a client, but would catches issues like pantsbuild#17672 and pantsbuild#17692. Fixes: - Bad debugpy ICs - Untracked issue where the process would always return 0 - The config wouldn't be used if provided - Removes the reliance on `importlib_metadata` to load the entrypoint, instead re-enters the already executing pex in-process
- Loading branch information
1 parent
ddb01e4
commit 22c83f1
Showing
9 changed files
with
154 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
import pytest | ||
|
||
from pants.backend.python.subsystems.debugpy import DebugPy | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def debugpy_dont_wait_for_client(monkeypatch): | ||
old_debugpy_get_args = DebugPy.get_args | ||
|
||
def get_debugpy_args_but_dont_wait_for_client(*args, **kwargs): | ||
result = list(old_debugpy_get_args(*args, **kwargs)) | ||
result.remove("--wait-for-client") | ||
return tuple(result) | ||
|
||
monkeypatch.setattr(DebugPy, "get_args", get_debugpy_args_but_dont_wait_for_client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.