Commit graph

1335 commits

Author SHA1 Message Date
Pavel Minaev
d8e4679553 Refactor test_threads to use the new test API. 2019-09-27 18:07:50 -07:00
Pavel Minaev
87ea74ef80 Refactor test_tracing to use the new test API. 2019-09-27 18:07:50 -07:00
Pavel Minaev
b4cbae7611 Refactor test_vs_specific to use the new test API. 2019-09-27 18:07:50 -07:00
Pavel Minaev
cd5ebd1274 Add safety checks to debug test framework to prevent accidental misuse. 2019-09-27 18:07:50 -07:00
Karthik Nadig
679bda4745
Fix tests (#1806)
* Fix tests

* Addressing comments
2019-09-27 18:04:18 -07:00
Pavel Minaev
8f358d6e0f Refactor tests.debug to accommodate ptvsd.server spawning the adapter, and remove the need for "custom_client" and "custom_server" start methods.
Fix launcher not propagating debuggee exit code.

Fix attach-by-PID without explicit --log-dir overriding PTVSD_LOG_DIR (and disabling logging).

Improve test logging, with a separate directory for every test.

Various test fixes.
2019-09-26 13:20:26 -07:00
Karthik Nadig
346ebd47cd
Add adapter pid to ignore list (#1801) 2019-09-24 17:31:52 -07:00
Graham Wheeler
a0e3cbcb30
Add sonar file. (#1800) 2019-09-23 13:36:10 -07:00
Fabio Zadrozny
bb5da4e19f enable_attach() no longer hangs if called from top level of an imported module on Python 2.7. Fixes #1788 2019-09-23 16:25:27 -03:00
Fabio Zadrozny
5fcc3e4cd5 Provide api to skip terminating child processes on terminate. Fixes #1786 2019-09-23 16:21:26 -03:00
Pavel Minaev
3908192ce7 Work around import deadlock in enable_attach() on Python 2 (#1788). 2019-09-20 12:50:52 -07:00
Fabio Zadrozny
8efec2b3f6 Properly show stack trace exception for unhandled exceptions with generator. Fixes #1744 2019-09-20 16:34:25 -03:00
Karthik Nadig
d8d8f36058
Add ppid to PydevdProcessInfo (#1791)
* Add ppid to PydevdProcessInfo

* Update tests
2019-09-20 08:44:46 -07:00
Karthik Nadig
2b429c7b21
Linter remove unused threading in util 2019-09-19 10:55:56 -07:00
Karthik Nadig
636400a24a
enable_attach should spawn adapter (#1784)
* Spawn adapter in enable attach.

* Addressing comments and simplifying

* Minor tweaks
2019-09-19 10:51:21 -07:00
Pavel Minaev
0825dbeb37 Add code coverage for tests (excluding ptvsd.server and pydevd).
Fix some issues on Python 2.7.

Remove dead code.
2019-09-18 21:42:51 -07:00
Fabio Zadrozny
b7c48cc9fe Provide api to launch python executable without subprocess patching. Fixes #1711 (#1779) 2019-09-17 22:24:52 -07:00
Fabio Zadrozny
c4ef317009 Provide a way to peek at DAP messages received and sent by pydevd. Fixes #1765 (#1774) 2019-09-16 19:19:22 -07:00
Pavel Minaev
0be597c4b2 Fix #1769: Logpoint messages aren't printed for "launch"
When using launcher to redirect output, tell pydevd to not perform redirection.

Always propagate "output" events from the server to the IDE.

Fix test_log_point to not assume that logpoint output is strictly ordered wrt regular output.
2019-09-16 12:49:28 -07:00
Pavel Minaev
9692e9770f Replace --multiprocess CLI switch with --no-subprocesses to reflect multiproc debugging being on by default.
Fix test_parse_args accordingly.
2019-09-14 01:54:08 -07:00
Pavel Minaev
76a21e19d9 Rename ptvsd.server.main -> ptvsd.server.cli, for consistency with ptvsd.server.api. 2019-09-14 01:54:08 -07:00
Pavel Minaev
e729b32ee6 Fix "output" event propagation from server to only exclude stdout and stderr when launcher is present. 2019-09-13 11:05:41 -07:00
Pavel Minaev
03b04928e1 Fix test_vs_specific 2019-09-13 11:05:41 -07:00
Pavel Minaev
f00075ffd3 Fix test_disconnect 2019-09-13 11:05:41 -07:00
Pavel Minaev
d5441a0363 Fix feature flags in pydevd "initialize" response. 2019-09-13 11:05:41 -07:00
Pavel Minaev
bb4bc24abf Don't try to gracefully disconnect from the adapter if test fails. 2019-09-13 11:05:41 -07:00
Pavel Minaev
b6d23c4356 test_exception fixes. 2019-09-12 22:33:26 -07:00
Pavel Minaev
fef15c91c9 Fix \r\n not processed in output captured by the launcher. 2019-09-12 22:33:26 -07:00
Pavel Minaev
8ab0d0d0d6 Fix multiprocessing in Django and Flask tests. 2019-09-12 22:33:26 -07:00
Pavel Minaev
823e221c98 Add support for ptvsd.attach() in "attach" request. 2019-09-12 22:33:26 -07:00
Pavel Minaev
1b9688652d Don't apply timeout to the IDE->adapter connection. 2019-09-12 22:33:26 -07:00
Fabio Zadrozny
63768ba41c Support for terminate and terminateDebuggee. Fixes #1755 2019-09-12 12:05:26 -03:00
Pavel Minaev
eb1bb4dd5b Test fixes. 2019-09-11 20:12:12 -07:00
Fabio Zadrozny
d2055ed968
Merge pull request #1758 from fabioz/dbg_adapter_refactor_merge
Merging master > dbg_adapter_refactor.
2019-09-11 10:22:04 -03:00
Pavel Minaev
340942aafc Fix #1695: Handle IDE, launcher, debug server, and no-debug disconnect
Fix #1721 "runInTerminal" is broken on non-Windows platforms.

Fix #1722: Output is not captured in "noDebug" with "runInTerminal"

Groundwork for #1713: adapter: multiple concurrent sessions

Move "launch" request parsing and debuggee process spawning, PID reporting and tracking, stdio "output" capture, and exit code reporting into launcher. Launcher now communicates to the adapter via a full-fledged message channel.

Refactor adapter. Add an abstraction for a debug session, and treat IDE, launcher, and debug server as separate components managed by that session.

Improve adapter logging to capture information about current debug session, and current message handler if any.

Fix reporting exceptions from message handlers.

Various test fixes.
2019-09-10 15:12:23 -07:00
Fabio Zadrozny
fd20f005e1 Merge master > dbg_adapter_refactor 2019-09-10 09:52:59 -03:00
Fabio Zadrozny
522f60cc3b Add support for PyPy. Fixes #835 2019-09-10 07:51:26 -03:00
Karthik Nadig
30615996ba
More test fixes (#1753)
* Migrate tracing feature and update tracing tests

* Other minor fixes

* fix resume on stepping
2019-09-07 10:46:00 -07:00
Karthik Nadig
7623560e3d
Fixes and move more helpers. (#1752) 2019-09-06 14:47:47 -07:00
Karthik Nadig
90d3a6f1ca
Move new tests from master to refactor branch (#1750)
* Add test_step_multi_threads

* Add more tests
2019-09-06 13:39:10 -07:00
Karthik Nadig
6e44d161ca
Fix for attach to pid tests (#1747)
* Fix for attach to pid tests

* Address comments.

* More asserts and comments.
2019-09-05 18:12:22 -07:00
Fabio Zadrozny
90298c4e79 Password no longer echoed in getpass (in Windows). Fixes #1723 2019-08-30 08:04:27 -03:00
Fabio Zadrozny
f45444f9f9 Make it possible to evaluate without a frameId. Fixes #1716 2019-08-30 08:01:54 -03:00
Karthik Nadig
2a367b2f4b
Bunch of minor test fixes (#1726)
* Bunch of minor test fixes

* Fix linter and multiproc

* Remove missed os.environ

* Rename and move stop_debugging

* Add evaluate helper

* Add exit_code property

* Enable pytest and flake8 in workspace

* Fix test failure

* Set ptvsd python path in tests

* Rename exit_code to expected_exit_code
2019-08-29 00:19:50 -07:00
Fabio Zadrozny
20d0f1a0bc Add processId to initialize response. Fixes #1717 2019-08-28 07:43:17 -03:00
Fabio Zadrozny
816ccb631b Provide access tokens in debugger. Fixes #1710 2019-08-28 07:43:17 -03:00
Pavel Minaev
5f2cb304a6 Use pydevd.settrace() argument instead of patch_new_process_functions() to enable multiprocessing.
Add multiprocessing= argument to attach() and enable_attach().

Refactor common code in attach() and enable_attach().

Remove broken legacy multiproc implementation.
2019-08-24 15:38:48 -07:00
Pavel Minaev
915515d910 Fix output capture for "noDebug".
Ensure that all captured output is reported to the IDE before reporting process exit.

Correctly report "process", "exited", and "terminated" events for "noDebug".

Don't treat partial message reads as fatal error.

Switch test_nodebug to "internalConsole", so that it can properly produce "output" events.

Expect failure response from "setBreakpoints" in test_nodebug.

Fix environment dict being shared between subsequent test runs, causing spurious enable_attach() in debuggee.

Fix ordering in debuggee and adapter cleanup in debug.Session.

Fix launcher.py on Python 2.7
2019-08-24 15:38:48 -07:00
Karthik Nadig
3158583bd3
Fix some tests. (#1719)
* Don't wait for thread event

* Fix get variables

* Fix completion tests

* Fix evaluate tests

* Fix linter
2019-08-23 10:28:46 -07:00
Karthik Nadig
2afcdc91f5
Minor fixes (#1718)
* Fix missed return

* Remove threading check
2019-08-22 17:39:35 -07:00