Commit graph

738 commits

Author SHA1 Message Date
Pavel Minaev
40f1ded82c Explicitly stop the test watchdog at exit. 2019-07-18 10:13:02 -07:00
Pavel Minaev
c04d394a73 Make test_attach parameters clearer. 2019-07-18 10:13:02 -07:00
Pavel Minaev
2963bf98fe Skip test_reattach (#1594) 2019-07-18 10:13:02 -07:00
Pavel Minaev
44ca8fa3fc Fix #1555: Child process watchdog for tests
Implement per-test-runner out-of-process watchdog for processes spawned by tests.

Add file logging for tests and watchdog.

Improve stdio capture in debug.Session when test fails.

Remove redundant logging in debug.Session.
2019-07-18 10:13:02 -07:00
Pavel Minaev
5dcca5fce0 Fix wrapping in timeline logs, and increase the repr length limit accordingly. 2019-07-18 10:13:02 -07:00
Pavel Minaev
4cd1d4163f Fix #1585: Output tests fail sporadically
Wait on a breakpoint before checking output.

Add temp workaround for #1574: Flask tests fail with "no such option: --wait" on windows py27

Pin Flask version to last known good one in tests/requirements.txt.

Other fixes and improvements:

Make start_method mandatory for debug.Session to avoid problems with tests forgetting to specify it.

Add debug_me.scratchpad to enable async communication between test code and debuggee.

Improve debug.Session logging.

Improve test_attach.
2019-07-18 10:13:02 -07:00
Pavel Minaev
edd5753d7e Further improve timeline logging:
Reformat various timeline log entries to improve readability.

Add pretty-printing of composite expectations, to match pretty-printed JSON.

Avoid redundant repetitions of messages when explaining how occurrences matched expectations.
2019-07-18 10:13:02 -07:00
Pavel Minaev
22f25c8d04 Fix timeline logging on Python 2. 2019-07-18 10:13:02 -07:00
Pavel Minaev
c511e98b02 Remove prints in tests outside of the code being debugged - use logging instead. 2019-07-18 10:13:02 -07:00
Pavel Minaev
8d189c8e91 Improve timeline logging for DAP messages:
Show only the metadata necessary to identify the message to reduce verbosiy.

Use JSON representation for easy matching against message logs.
2019-07-18 10:13:02 -07:00
Pavel Minaev
c03206972d Fix remaining tests to reflect the debug adapter refactoring changes.
Fix Flask and Django multiprocess tests.

Fix test logs not being captured by pytest.

Fix "import debug_me" check improperly applied in tests where it is unnecessary.

Fix some clarifying patterns not respecting the underlying pattern.

Add pattern helpers for strings: starting_with, ending_with, containing.

Move DAP test helpers to a separate module, and add a helper for frames.

Add support for line markers when setting breakpoints and matching frames.

Assorted test fixes around handling of Unicode and paths.
2019-07-11 16:19:06 -07:00
Pavel Minaev
746bda561e Test fixes. 2019-07-09 12:01:13 -07:00
Pavel Minaev
42bbc0946d Test fixes. 2019-07-08 12:03:31 -07:00
Pavel Minaev
82b62b77b5 Fix #1551: Backchannel failures in tests
Fix various bugs around handling of disconnect in JsonIOStream and JsonMessageChannel.

Fix handling of DAP "terminated" event in debug.Session.

Add --ptvsd-logs and --pydevd-logs switches to pytest.

Improve message logging to fully capture the raw message data in the logs if deserialization fails.

Log all debuggee environment variables in debug.Session, and improve log readability.
2019-07-02 17:05:51 -07:00
Karthik Nadig
1e6d2269dd
Replace wait_for_thread_stopped with wait_for_stop (#1550)
* Replace wait_for_thread_stopped with wait_for_stop

* Switch flask tests to use flask server

* Assert linter

* Use marked lines

* Fix stack logging in tests

* Prevent black from formating some debug code

* Simplify flask tests

* Replace send_request(continue) with send_continue

* fix typo
2019-07-01 14:38:07 -07:00
Karthik Nadig
8d75d6d819
Test refactoring migrated to new api (#1544)
* Update ANY to some

* Refactor breakpoint lines in tests

* Replace old import and emable debug with debug_me

* Remove unused code

* Fix some linter issues

* Change from some.such_that to some.str.such_that

* Linting with black
2019-06-28 16:27:38 -07:00
Pavel Minaev
f71f0a5b0a Tests refactoring. (#1543) 2019-06-28 10:13:00 -07:00
Pavel Minaev
1e6ba092d3 Refactor messaging:
- better propagation of messages and errors
- implicit error handling for invalid messages
- fix various issues related to disconnecting

Fix messaging tests.

Separate formatter from logging for reuse.

Add more Python 2/3 compatibility helpers.
2019-06-18 18:08:49 -07:00
Pavel Minaev
0471474afe Remove unnecessary import. 2019-06-10 14:58:54 -07:00
Pavel Minaev
d68a5da4b1 Disable failing test_breakpoint_function per #1505 2019-06-10 14:58:54 -07:00
Pavel Minaev
ee7710adf6 Fix #1502: Concurrent DAP request processing
Add support for "yield" in request handlers.
2019-06-07 02:46:41 -07:00
Pavel Minaev
53aa9e8797 Fix linting issues. 2019-05-30 14:10:01 -07:00
Pavel Minaev
7fbd5feebf Fix imports to reflect the new package layout. 2019-05-30 13:47:56 -07:00
Pavel Minaev
8cca9fcd7a Reorganize source code to reflect the split between the adapter proper and the debug server. 2019-05-23 15:14:50 -07:00
Karthik Nadig
025c6c2f63
Ensure stop_on_entry is unset after first break. Fixes #1456 (#1457)
* Ensure stop_on_entry is unset after first break

* Update tests
2019-05-21 23:23:01 -07:00
Fabio Zadrozny
ff979215fc
Don't use sys.prefix for library roots. Fixes #1422 (#1455) 2019-05-21 15:28:13 -03:00
Pavel Minaev
ef6efe2176 Fix #1413: Stop on entry hangs the debugger
Reimplement ptvsd.debugger.debug() VS entry point via ptvsd.__main__.
2019-05-20 20:28:16 -07:00
Karthik Nadig
ec7f31a92a
Remove unused code (#1453)
* Remove unused pathutils

* Remove unsed run_code (#6)
2019-05-20 14:38:21 -07:00
Fabio Zadrozny
343ad5fbed Provide breakpoints in response. Fixes #1408 (#1425) 2019-05-16 14:24:33 -07:00
Fabio Zadrozny
e298fc54b4
Send DAP process event from pydevd. Fixes #1338 (#1420) 2019-05-16 09:19:30 -03:00
Karthik Nadig
3e89bde5ac
Ensure stop on entry reason is entry. Fixes #1387 (#1415)
* Ensure that stopped reason is 'entry' for stop on entry.

* Update cython wrappers

* Revert "Update cython wrappers"

This reverts commit d98efe2d8d1c0bf496b4f7905bc261170ac7477f.

* Generate .pyx and .c files.

* Update name

* .

* Update tests

* preserveFocusHint should be false for `entry`

* Fix #1418 and clean up

* Add log message if no main thread is found
2019-05-14 10:22:50 -07:00
Karthik Nadig
2653656cef
Redirect output setting changes (#1405)
* Move more settings to pydev

* Deprecate redirect output argument.

* Use warn.

* Add tests and cleanup
2019-05-08 11:48:11 -07:00
Fabio Zadrozny
ef6a679d0e
DAP: stop sending some events from pydevd. Fixes #1342 (#1406) 2019-05-08 10:31:15 -03:00
Fabio Zadrozny
e44dc09f57
Make it possible to edit variables in containers through the DAP. Fixes #1385. (#1391) 2019-04-30 14:32:33 -03:00
fabioz
3711d92935 Properly handle case where a thread event can be sent before issuing a threads request. 2019-04-29 07:58:44 -03:00
fabioz
b44a17647b Showing pydevd logs on ptvsd failures on ci. 2019-04-29 07:58:44 -03:00
fabioz
bc7903651b Thread id from pydevd is now int32. Fixes #1331, #1339, #1332 2019-04-29 07:58:44 -03:00
Karthik Nadig
5ba6681f0c
Move source request to pydevd. Fixes #1333 (#1380)
* Move source request to pydevd

* Update test to include  sourceReference 0 case

* Check the message for sourceReference 0 case
2019-04-22 12:38:57 -07:00
Fabio Zadrozny
60da1fee41
Port stopped and continued events to pydevd. Fixes #1340, #1341 (#1373)
* Port stopped and continued events to pydevd. Fixes #1340, #1341

* Use 'ptvsd.log.exception' instead of traceback.print_exc.
2019-04-19 09:09:52 -03:00
Fabio Zadrozny
4706f63bae Check if file is in project with original and not translated file. Fixes #1325 (#1362) 2019-04-16 14:37:39 -07:00
Karthik Nadig
b26bcd0778
Set don't trace ptvsd files via json message. Fixes #1220 (#1346)
* Set dont trace ptvsd files via json message.

* Tests for set dont trace

* Cleanup and fixes

* Use custom json to generate DAP schema extensions

* Address comments

* Address more comments

* Try fix the breakpoint() issue

* Always true

* Try this

* Address comments.
2019-04-16 09:11:09 -07:00
Karthik Nadig
66deeb108e
Turn off sending continued events by default. (#1360)
* Send continued event only if needed.

* Update tests that are using continued event.

* str because python 2.7 on windows

* Address comments
2019-04-15 19:25:15 -07:00
Fabio Zadrozny
5e703f5a8f
Handle receiving old frameId. Fixes #1326 (#1352)
* Handle receiving old frameId. Fixes #1326

* Make _forward_request_to_pydevd properly properly deal with messages where success==False.
2019-04-15 08:30:16 -03:00
Fabio Zadrozny
9ec0b7afad Normalize path translation files according to client OS. Fixes #1311 (#1328)
* Fix test in pydevd.

* Normalize path translation files according to client OS. Fixes #1311
2019-04-10 18:03:51 -07:00
Karthik Nadig
87349f0f87
Ensure all output is received for tab output test (#1320) 2019-04-06 21:13:02 -07:00
Pavel Minaev
c9e5ab5b3f Fix process exit code retrieval in DebugSession. 2019-04-04 19:21:52 -07:00
Karthik Nadig
b6e83df4bb
Set correct reason when stopped on 'goto' (#1316) 2019-04-04 16:10:42 -07:00
Karthik Nadig
32e4f0ebc8
Add setting to limit number of lines in stack for exception details. Fixes #582 (#1309)
* Add maxExcpetionStackFrames setting

* Tests for maxExcpetionStackFrames setting

* Set default as all frames

* Address comments

* Fix merge issue
2019-04-04 14:51:44 -07:00
Pavel Minaev
1f7a277b93 Fix merge issue in test_raise_exception_options 2019-04-04 13:28:49 -07:00
Pavel Minaev
083f8b5f9c Fix incorrect post-exception cleanup in test_reuse_same_address_port 2019-04-04 13:28:49 -07:00