-
Notifications
You must be signed in to change notification settings - Fork 88
VSCODE-113: Add tests for the new connection event #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCODE-113: Add tests for the new connection event #87
Conversation
src/connectionController.ts
Outdated
this.eventEmitter.emit(DataServiceEventTypes.ACTIVE_CONNECTION_CHANGED); | ||
|
||
if (this._telemetryController) { | ||
if (this._telemetryController?.needTelemetry()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here - I think because we check if (this.needTelemetry()) { in the telemetry controller we can remove this if?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one we actually want to keep, since this.sendTelemetry()
requests cloud info what takes a while and can cause a timeout in tests. But I removed the rest of these checks from other controllers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. And thanks cleaning up a lot of the connection testing.
I also like that the telemetry controller is always present, but when the sendTelemetry
setting is off it just doesn't track the event. I think because it's now always present and uses the flag to determine whether or not to send events we may want to make telemetry controller a required parameter in constructors instead of optional. I think it would be a lot of testing changes though so not worth at this time.
Couple small comments on where we check needTelemetry
.
Ah oops I left the comments not in the review but as single comments 😅
@Anemy Refactored according to your comments ✨ Nice suggestion! While refactoring I have found a couple of fluky async tests and fixed them. Hopefully, this will improve stability of pipelines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Description
Add tests for the
new connection
event.Checklist
Motivation and Context
Types of changes