-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add telemetry for when user triggers testing from CLI #25103
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: karthiknadig <3840081+karthiknadig@users.noreply.github.com>
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.
Remove nose
. We don’t support that anymore.
Co-authored-by: karthiknadig <3840081+karthiknadig@users.noreply.github.com>
I've removed nose test support as requested. All related detection code and test cases have been removed in commit 097da2d. |
looks good to me- fixed linting as well. @karthiknadig am I good to take this out of draft and get reviews? [edit nvm] |
// Check for test commands | ||
if ( | ||
lower.includes('pytest') || | ||
(lower.startsWith('python') && lower.includes(' -m pytest')) || |
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.
I think we can consolidate (lower.startsWith('python') && lower.includes(' -m pytest')) || (lower.startsWith('py ') && lower.includes(' -m pytest')) || (lower.startsWith('python') && lower.includes(' -m unittest')) || (lower.startsWith('py ') && lower.includes(' -m unittest')) ||
into two conditionals. One for starting with 'python' other for 'py'
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.
I've consolidated the conditionals as suggested into two statements - one for commands starting with 'python' and another for commands starting with 'py'. This makes the code more readable while maintaining the same functionality. All tests are passing. Changes in commit 6d2e428.
Co-authored-by: anthonykim1 <62267334+anthonykim1@users.noreply.github.com>
This PR adds telemetry to capture when users run Python tests via the command line in the terminal. This helps us get a better understanding of testing usage in the extension outside of the testing UI.
Changes
UNITTEST_RUN_CLI
to track CLI test executionpython -m pytest
,pytest
,py.test
python -m unittest
python -m nose
Implementation
The implementation uses the existing terminal command detection system that already tracks when users run Python scripts in the terminal. When a test command is detected, we send a specific telemetry event rather than the general REPL telemetry.
This implementation has minimal impact on performance as it just adds an additional condition to the existing command detection logic that already runs for every terminal command. The telemetry is sent asynchronously and doesn't block terminal execution.
Fixes #24562.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
/usr/bin/fwupdmgr refresh
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.