Skip to content

Commit

Permalink
Merge pull request #13 from int19h/tele
Browse files Browse the repository at this point in the history
Send both "ptvsd" and "debugpy" telemetry events for smooth transition.
  • Loading branch information
Pavel Minaev authored Jan 29, 2020
2 parents c53bd33 + 367ff72 commit 7a2891b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/debugpy/adapter/ide.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ def __init__(self, sock):
session.ide = self
session.register()

# For the transition period, send the telemetry events with both old and new
# name. The old one should be removed once the new one lights up.
self.channel.send_event(
"output",
{
"category": "telemetry",
"output": "ptvsd",
"data": {"packageVersion": debugpy.__version__},
},
)
self.channel.send_event(
"output",
{
Expand Down
28 changes: 19 additions & 9 deletions tests/debug/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ def __init__(self, debug_config=None):
"""

self.log_dir = (
None
if log.log_dir is None
else py.path.local(log.log_dir) / str(self)
None if log.log_dir is None else py.path.local(log.log_dir) / str(self)
)
"""The log directory for this session. Passed via DEBUGPY_LOG_DIR to all spawned
child processes.
Expand Down Expand Up @@ -530,12 +528,24 @@ def _start_channel(self, stream):
self.channel = messaging.JsonMessageChannel(stream, handlers)
self.channel.start()

telemetry = self.wait_for_next_event("output")
assert telemetry == {
"category": "telemetry",
"output": "debugpy",
"data": {"packageVersion": some.str},
}
self.wait_for_next(
timeline.Event(
"output",
{
"category": "telemetry",
"output": "ptvsd",
"data": {"packageVersion": some.str},
},
)
& timeline.Event(
"output",
{
"category": "telemetry",
"output": "debugpy",
"data": {"packageVersion": some.str},
},
)
)

self.request(
"initialize",
Expand Down

0 comments on commit 7a2891b

Please sign in to comment.