Send both "ptvsd" and "debugpy" telemetry events for smooth transition.

This commit is contained in:
Pavel Minaev 2020-01-29 13:37:53 -08:00
parent a1e4eb3c5e
commit 367ff72788
2 changed files with 29 additions and 9 deletions

View file

@ -77,6 +77,16 @@ class IDE(components.Component, sockets.ClientConnection):
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",
{

View file

@ -149,9 +149,7 @@ class Session(object):
"""
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.
@ -530,12 +528,24 @@ class Session(object):
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",