def test_simple_debug_launch_stop_on_robot_and_pydevd( debugger_api: _DebuggerAPI): from robocorp_ls_core.debug_adapter_core.dap.dap_schema import TerminatedEvent from robocorp_ls_core.debug_adapter_core.dap.dap_schema import ThreadsResponse debugger_api.initialize() target = debugger_api.get_dap_case_file("case_python.robot") debugger_api.target = target mypylib = debugger_api.get_dap_case_file("mypylib.py") debugger_api.launch(target, debug=True) threads_response: ThreadsResponse = (debugger_api.list_threads()) assert len(threads_response.body.threads) == 1 bp_robot = debugger_api.get_line_index_with_content("Some Call") bp_pydevd = debugger_api.get_line_index_with_content("break here", filename=mypylib) debugger_api.set_breakpoints(target, bp_robot) debugger_api.set_breakpoints(mypylib, bp_pydevd) debugger_api.configuration_done() json_hit = debugger_api.wait_for_thread_stopped(file="case_python.robot") msg = debugger_api.continue_event(json_hit.thread_id) debugger_api.wait_for_thread_stopped(file="mypylib.py") msg = debugger_api.continue_event(json_hit.thread_id, accept_terminated=True) if not isinstance(msg, TerminatedEvent): debugger_api.read(TerminatedEvent)
def test_simple_debug_launch(debugger_api: _DebuggerAPI): from robocorp_ls_core.debug_adapter_core.dap.dap_schema import TerminatedEvent debugger_api.initialize() target = debugger_api.get_dap_case_file("case_log.robot") debugger_api.launch(target, debug=True) threads_response = (debugger_api.list_threads() ) #: :type thread_response: ThreadsResponse assert len(threads_response.body.threads) == 1 debugger_api.set_breakpoints(target, 4) debugger_api.configuration_done() debugger_api.wait_for_thread_stopped() debugger_api.continue_event() debugger_api.read(TerminatedEvent)
def test_simple_debug_launch_stop_on_robot(debugger_api: _DebuggerAPI): from robocorp_ls_core.debug_adapter_core.dap.dap_schema import TerminatedEvent from robocorp_ls_core.debug_adapter_core.dap.dap_schema import ThreadsResponse debugger_api.initialize() target = debugger_api.get_dap_case_file("case_log.robot") debugger_api.launch(target, debug=True) threads_response: ThreadsResponse = (debugger_api.list_threads()) assert len(threads_response.body.threads) == 1 thread = next(iter(threads_response.body.threads)) debugger_api.set_breakpoints(target, 4) debugger_api.configuration_done() json_hit = debugger_api.wait_for_thread_stopped(file="case_log.robot") assert json_hit.thread_id == thread["id"] debugger_api.continue_event(json_hit.thread_id) debugger_api.read(TerminatedEvent)