mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Actually run full test matrix for DEBUGBY_TESTS_FULL=1.
Fix full run test failures.
This commit is contained in:
parent
6ad1382a8c
commit
73a4c8b712
10 changed files with 53 additions and 34 deletions
|
|
@ -7,12 +7,14 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||
"""debugpy tests
|
||||
"""
|
||||
|
||||
import os
|
||||
import pkgutil
|
||||
import py
|
||||
import pytest
|
||||
|
||||
# Do not import anything from debugpy until assert rewriting is enabled below!
|
||||
|
||||
full = int(os.environ.get("DEBUGPY_TESTS_FULL", "0")) != 0
|
||||
|
||||
root = py.path.local(__file__) / ".."
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import re
|
|||
import sys
|
||||
|
||||
from debugpy.common import fmt
|
||||
import tests
|
||||
from tests import debug, test_data
|
||||
from tests.debug import runners, targets
|
||||
from tests.patterns import some
|
||||
|
|
@ -17,9 +18,10 @@ from tests.patterns import some
|
|||
bp_root = test_data / "bp"
|
||||
|
||||
|
||||
@pytest.fixture(params=[runners.launch, runners.attach_listen["api"]])
|
||||
def run(request):
|
||||
return request.param
|
||||
if not tests.full:
|
||||
@pytest.fixture(params=[runners.launch, runners.attach_connect["cli"]])
|
||||
def run(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.mark.parametrize("target", targets.all_named)
|
||||
|
|
@ -171,13 +173,14 @@ def test_error_in_condition(pyfile, target, run, error_name):
|
|||
},
|
||||
)
|
||||
|
||||
assert not session.captured_stdout()
|
||||
if "internalConsole" not in str(run):
|
||||
assert not session.captured_stdout()
|
||||
|
||||
error_name = error_name.encode("ascii")
|
||||
if expect_traceback:
|
||||
assert error_name in session.captured_stderr()
|
||||
else:
|
||||
assert error_name not in session.captured_stderr()
|
||||
error_name = error_name.encode("ascii")
|
||||
if expect_traceback:
|
||||
assert error_name in session.captured_stderr()
|
||||
else:
|
||||
assert error_name not in session.captured_stderr()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("condition", ["condition", ""])
|
||||
|
|
@ -230,7 +233,8 @@ def test_log_point(pyfile, target, run, condition):
|
|||
|
||||
# print() should produce both actual output, and "output" events on stderr,
|
||||
# but logpoints should only produce "output" events on stdout.
|
||||
assert not session.captured_stdout()
|
||||
if "internalConsole" not in str(run):
|
||||
assert not session.captured_stdout()
|
||||
|
||||
expected_stdout = "".join(
|
||||
(fmt(r"{0}\r?\n", re.escape(str(i))) for i in range(0, 10))
|
||||
|
|
|
|||
|
|
@ -6,14 +6,16 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||
|
||||
import pytest
|
||||
|
||||
import tests
|
||||
from tests import code, debug, log, test_data
|
||||
from tests.debug import targets
|
||||
from tests.patterns import some
|
||||
|
||||
|
||||
@pytest.fixture(params=targets.all_named)
|
||||
def target(request):
|
||||
return request.param
|
||||
if not tests.full:
|
||||
@pytest.fixture(params=targets.all_named)
|
||||
def target(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.mark.parametrize("scenario", ["exclude_by_name", "exclude_by_dir"])
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ def test_gevent(pyfile, target, run):
|
|||
with debug.Session() as session:
|
||||
session.config["gevent"] = True
|
||||
|
||||
if str(run) == "listen(cli)" or str(run) == "connect(cli)":
|
||||
if str(run).startswith("attach"):
|
||||
session.spawn_debuggee.env["GEVENT_SUPPORT"] = "True"
|
||||
|
||||
with run(session, target(code_to_debug)):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ def test_justmycode_frames(pyfile, target, run, jmc):
|
|||
import debuggee
|
||||
|
||||
debuggee.setup()
|
||||
print("break here") # @bp
|
||||
|
||||
import this # @bp
|
||||
assert this
|
||||
|
||||
with debug.Session() as session:
|
||||
session.config["justMyCode"] = bool(jmc)
|
||||
|
|
@ -37,12 +39,14 @@ def test_justmycode_frames(pyfile, target, run, jmc):
|
|||
|
||||
session.request("stepIn", {"threadId": stop.thread_id})
|
||||
|
||||
# With JMC, it should step out of the function, remaining in the same file.
|
||||
# Without JMC, it should step into stdlib.
|
||||
expected_path = some.path(code_to_debug)
|
||||
if not jmc:
|
||||
# "stepIn" should stop somewhere inside stdlib
|
||||
session.wait_for_stop(
|
||||
"step",
|
||||
expected_frames=[
|
||||
some.dap.frame(~some.str.equal_to(code_to_debug), some.int)
|
||||
],
|
||||
)
|
||||
session.request_continue()
|
||||
expected_path = ~expected_path
|
||||
session.wait_for_stop(
|
||||
"step",
|
||||
expected_frames=[some.dap.frame(some.dap.source(expected_path), some.int)],
|
||||
)
|
||||
|
||||
session.request_continue()
|
||||
|
|
|
|||
|
|
@ -8,14 +8,16 @@ import pytest
|
|||
import sys
|
||||
|
||||
import debugpy
|
||||
import tests
|
||||
from tests import debug
|
||||
from tests.debug import runners
|
||||
from tests.patterns import some
|
||||
|
||||
|
||||
@pytest.fixture(params=[runners.launch] + runners.all_attach_socket)
|
||||
def run(request):
|
||||
return request.param
|
||||
if not tests.full:
|
||||
@pytest.fixture(params=[runners.launch] + runners.all_attach_socket)
|
||||
def run(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -6,14 +6,16 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||
|
||||
import pytest
|
||||
|
||||
import tests
|
||||
from tests import debug, test_data
|
||||
from tests.debug import targets
|
||||
from tests.patterns import some
|
||||
|
||||
|
||||
@pytest.fixture(params=targets.all_named)
|
||||
def target(request):
|
||||
return request.param
|
||||
if not tests.full:
|
||||
@pytest.fixture(params=targets.all_named)
|
||||
def target(request):
|
||||
return request.param
|
||||
|
||||
|
||||
def test_with_dot_remote_root(pyfile, long_tmpdir, target, run):
|
||||
|
|
|
|||
|
|
@ -7,14 +7,16 @@ from __future__ import absolute_import, division, print_function, unicode_litera
|
|||
import pytest
|
||||
import sys
|
||||
|
||||
import tests
|
||||
from tests import debug
|
||||
from tests.debug import runners
|
||||
from tests.patterns import some
|
||||
|
||||
|
||||
@pytest.fixture(params=[runners.launch, runners.attach_listen["api"]])
|
||||
def run(request):
|
||||
return request.param
|
||||
if not tests.full:
|
||||
@pytest.fixture(params=[runners.launch, runners.attach_listen["api"]])
|
||||
def run(request):
|
||||
return request.param
|
||||
|
||||
|
||||
def test_with_path_mappings(pyfile, tmpdir, target, run):
|
||||
|
|
|
|||
|
|
@ -13,12 +13,13 @@ import threading
|
|||
import types
|
||||
|
||||
from debugpy.common import compat, fmt, log, timestamp
|
||||
import tests
|
||||
from tests import code, logs
|
||||
from tests.debug import runners, session, targets
|
||||
|
||||
# Set up the test matrix for various code types and attach methods
|
||||
|
||||
if int(os.environ.get("DEBUGPY_TESTS_FULL", "0")):
|
||||
if tests.full:
|
||||
TARGETS = targets.all_named
|
||||
RUNNERS = runners.all_launch + runners.all_attach_socket
|
||||
else:
|
||||
|
|
|
|||
2
tox.ini
2
tox.ini
|
|
@ -3,7 +3,7 @@ envlist = py{27,35,36,37,38}{,-cov}
|
|||
|
||||
[testenv]
|
||||
deps = -rtests/requirements.txt
|
||||
passenv = DEBUGPY_LOG_DIR TRAVIS
|
||||
passenv = DEBUGPY_LOG_DIR DEBUGPY_TESTS_FULL TRAVIS
|
||||
setenv =
|
||||
DEBUGPY_TEST=1
|
||||
commands =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue