chat - add a smoke test to check for AI disabling support#273940
chat - add a smoke test to check for AI disabling support#273940
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds smoke tests for chat functionality, specifically testing the ability to disable AI features. The changes introduce a new chat test suite and supporting automation infrastructure.
- Adds a new smoke test file
chat.test.tsthat tests disabling AI features via settings - Implements a new
getCommandNames()method in the automation framework to retrieve command names from the command palette - Integrates the chat test suite into the main smoke test runner with appropriate conditions
- Disables the
vscode.vscode-api-testsextension during Electron smoke tests to prevent interference
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/smoke/src/main.ts | Imports and sets up the new chat test suite, conditionally running it for non-web environments |
| test/smoke/src/areas/chat/chat.test.ts | New test file verifying that AI features can be disabled via settings |
| test/automation/src/quickaccess.ts | Adds getCommandNames() method to retrieve command names with retry logic for flaky test scenarios |
| test/automation/src/electron.ts | Disables vscode.vscode-api-tests extension to prevent test interference |
| src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts | Adds precondition to "View Chat Terminals" action to require chat to be enabled |
| continue; | ||
| } | ||
|
|
||
| if (command.indexOf('Chat') >= 0 || command.indexOf('Agent') >= 0 || command.indexOf('Copilot') >= 0) { |
There was a problem hiding this comment.
Use includes() instead of indexOf() for better readability and clarity. Replace command.indexOf('Chat') >= 0 with command.includes('Chat').
| if (command.indexOf('Chat') >= 0 || command.indexOf('Agent') >= 0 || command.indexOf('Copilot') >= 0) { | |
| if (command.includes('Chat') || command.includes('Agent') || command.includes('Copilot')) { |
| } | ||
|
|
||
| if (unexpectedFound.length > 0) { | ||
| throw new Error(`Unexpected AI related commands found after having disabled AI features: ${JSON.stringify(unexpectedFound, undefined, 0)}`); |
There was a problem hiding this comment.
The third argument to JSON.stringify() should be 2 or '\t' for readable indentation. Using 0 disables indentation, which may make error messages harder to read in logs. Consider using JSON.stringify(unexpectedFound, undefined, 2) for better formatting.
| throw new Error(`Unexpected AI related commands found after having disabled AI features: ${JSON.stringify(unexpectedFound, undefined, 0)}`); | |
| throw new Error(`Unexpected AI related commands found after having disabled AI features: ${JSON.stringify(unexpectedFound, undefined, 2)}`); |
No description provided.