Skip to content

Replace deprecated telemetry setting in the tests#3362

Merged
shati-patel merged 1 commit intomainfrom
shati-patel/telemetry-test
Feb 15, 2024
Merged

Replace deprecated telemetry setting in the tests#3362
shati-patel merged 1 commit intomainfrom
shati-patel/telemetry-test

Conversation

@shati-patel
Copy link
Copy Markdown
Contributor

In #2824, we added support for the telemetry.telemetryLevel setting.
However, our tests still tested the deprecated telemetry.enableTelemetry setting, so I've now replaced those checks with telemetry.telemetryLevel. I could have kept tests for the deprecated setting as well, but it didn't seem worthwhile.

I've just done a basic replacement of telemetry.enableTelemetry: true/false with telemetry.telemetryLevel: "all"/"off". The telemetry levels can be a bit more fine-grained than that, but I didn't want to add more complexity to the tests in this PR 😄

(More comprehensive testing could be a follow-up PR, but I don't think it's super important, since the decision to send telemetry is handled by VS Code libraries instead of by us.)

Checklist

N/A—test changes only 🧪

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@shati-patel shati-patel marked this pull request as ready for review February 14, 2024 16:32
@shati-patel shati-patel requested a review from a team as a code owner February 14, 2024 16:32
Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

Thanks.


// Need to wait some time since the onDidChangeConfiguration listeners fire
// asynchronously. Must ensure they to complete in order to have a successful test.
await wait(100);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An observation, but not introduced in this PR so doesn't need to be address now: We seem to call enableTelemetry and setTelemetry sequentially. They're both updating the config and then wait for 100ms. I wonder if we could merge the calls into one and only wait once. It would shave off some waiting timing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! 👀 I'll leave things as-is for now, since there'll likely be more changes to the tests anyway, if we manage to upgrade the telemetry package 🤞🏽

@shati-patel shati-patel merged commit b7010aa into main Feb 15, 2024
@shati-patel shati-patel deleted the shati-patel/telemetry-test branch February 15, 2024 10:22
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