Skip to content

Conversation

alenakhineika
Copy link
Contributor

@alenakhineika alenakhineika commented May 12, 2020

Description

Add tests for the new connection event.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@alenakhineika alenakhineika marked this pull request as ready for review May 12, 2020 08:43
@alenakhineika alenakhineika requested a review from Anemy May 12, 2020 08:43
this.eventEmitter.emit(DataServiceEventTypes.ACTIVE_CONNECTION_CHANGED);

if (this._telemetryController) {
if (this._telemetryController?.needTelemetry()) {
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

@Anemy Anemy left a 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 😅

@alenakhineika
Copy link
Contributor Author

@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.

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@alenakhineika alenakhineika merged commit 3b740fe into master May 12, 2020
@alenakhineika alenakhineika deleted the VSCODE-113-tests-for-new-connection-event branch May 12, 2020 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants