mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
Try to fix Chat smoke test flake (#320380)
* Try to fix Chat smoke test flake
This commit is contained in:
@@ -91,11 +91,15 @@ function activate(context) {
|
||||
})
|
||||
);
|
||||
|
||||
// Open a chat session editor of the given type. The required settings
|
||||
// (chat.disableAIFeatures = false, the corresponding *Agent.enabled flag)
|
||||
// must be written to settings.json by the test before invoking this
|
||||
// command. Writing them here via `workspace.getConfiguration().update()`
|
||||
// races with copilot-chat registering its configuration schema and was
|
||||
// the source of the original Chat Sessions smoke test flake.
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('smoketest.openCopilotCliChat', async () => {
|
||||
const command = 'workbench.action.chat.openNewSessionEditor.copilotcli';
|
||||
await vscode.workspace.getConfiguration('chat').update('disableAIFeatures', false, vscode.ConfigurationTarget.Global);
|
||||
await vscode.workspace.getConfiguration('github.copilot.chat').update('backgroundAgent.enabled', true, vscode.ConfigurationTarget.Global);
|
||||
await vscode.commands.executeCommand('github.copilot.debug.extensionState');
|
||||
await waitForCommand(command, 60_000);
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
@@ -106,8 +110,6 @@ function activate(context) {
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand('smoketest.openClaudeChat', async () => {
|
||||
const command = 'workbench.action.chat.openNewSessionEditor.claude-code';
|
||||
await vscode.workspace.getConfiguration('chat').update('disableAIFeatures', false, vscode.ConfigurationTarget.Global);
|
||||
await vscode.workspace.getConfiguration('github.copilot.chat').update('claudeAgent.enabled', true, vscode.ConfigurationTarget.Global);
|
||||
await vscode.commands.executeCommand('github.copilot.debug.extensionState');
|
||||
await waitForCommand(command, 60_000);
|
||||
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
|
||||
|
||||
@@ -73,6 +73,14 @@ export function setup(logger: Logger) {
|
||||
['github.copilot.chat.githubMcpServer.enabled', 'false'],
|
||||
['chat.mcp.discovery.enabled', 'false'],
|
||||
['chat.mcp.enabled', 'false'],
|
||||
// Pre-enable the chat session types that the tests open. Writing
|
||||
// these here (directly to settings.json) instead of from the
|
||||
// smoketest extension avoids racing with copilot-chat registering
|
||||
// its configuration schema — the original cause of the Chat
|
||||
// Sessions smoke test flake.
|
||||
['chat.disableAIFeatures', 'false'],
|
||||
['github.copilot.chat.backgroundAgent.enabled', 'true'],
|
||||
['github.copilot.chat.claudeAgent.enabled', 'true'],
|
||||
// Force the bundled Claude Agent SDK (avoid the experiment that
|
||||
// would route through the ms-vscode.vscode-claude-sdk extension,
|
||||
// which would attempt a network install during the smoke run).
|
||||
@@ -84,7 +92,7 @@ export function setup(logger: Logger) {
|
||||
await mockServer?.close();
|
||||
});
|
||||
|
||||
it.skip('Test Copilot CLI session', async function () {
|
||||
it('Test Copilot CLI session', async function () {
|
||||
const app = this.app as Application;
|
||||
const requestsBefore = mockServer.requestCount();
|
||||
|
||||
@@ -106,7 +114,7 @@ export function setup(logger: Logger) {
|
||||
);
|
||||
});
|
||||
|
||||
it.skip('Test Claude session', async function () {
|
||||
it('Test Claude session', async function () {
|
||||
const app = this.app as Application;
|
||||
const requestsBefore = mockServer.requestCount();
|
||||
logger.log(`Chat Sessions (Claude) mock requests before: ${requestsBefore}`);
|
||||
|
||||
Reference in New Issue
Block a user