Skip to content

Add the integration test to validate latest vs code with the elicitat…#2549

Draft
xiangyan99 wants to merge 9 commits intomainfrom
vscode_integration_test
Draft

Add the integration test to validate latest vs code with the elicitat…#2549
xiangyan99 wants to merge 9 commits intomainfrom
vscode_integration_test

Conversation

@xiangyan99
Copy link
Copy Markdown
Member

Add the integration test to validate latest vs code with the elicitation feature.

What does this PR do?

[Provide a clear, concise description of the changes]

[Add additional context, screenshots, or information that helps reviewers]

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Created a changelog entry if the change falls among the following: new feature, bug fix, UI/UX update, breaking change, or updated dependencies. Follow the changelog entry guide
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes running the script ./eng/scripts/Process-PackageReadMe.ps1. See Package README
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated command list in servers/Azure.Mcp.Server/docs/azmcp-commands.md
    • Ran ./eng/scripts/Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • Updated test prompts in servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline
…ion feature.

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

@jongio jongio left a comment

Choose a reason for hiding this comment

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

A couple of issues spotted in this draft:

The path normalization in the new PS script uses double-backslash replacement (Replace('\\\\', '/')) but every other script in eng/scripts/ uses single-backslash (Replace('\\', '/')). On Windows, \.Path returns paths like C:\code\mcp, so the double-backslash version won't match anything and the path stays unconverted.

The outerloop-test npm script installs @playwright/test@latest at runtime with --no-save --no-package-lock. This means different CI runs can pick up different Playwright versions - a Playwright breaking change could cause failures unrelated to code changes. Consider pinning to a major version (e.g. @playwright/test@^1) or adding a comment explaining the intent behind using @latest.

Minor: the test creates a temp directory via fs.mkdtemp but doesn't clean it up in the finally block. On long-lived CI agents, these accumulate.

Also the PR description template isn't filled in - it'd help reviewers to know which issue this addresses and what the testing strategy looks like.

. "$PSScriptRoot/../common/scripts/common.ps1"

$RepoRoot = $RepoRoot.Path.Replace('\\', '/')
$projectPath = Join-Path $RepoRoot $VsCodeProjectPath
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.

This should be Replace('\', '/') (single backslash) to match the convention in every other script under eng/scripts/. The double-backslash version won't match standard Windows paths like C:\code\mcp.

"lint": "eslint src --ext ts",
"test": "npm run compile && node ./out/test/runAllTests.js",
"unit-test": "npm run compile && node ./out/test/runUnitTests.js"
"unit-test": "npm run compile && node ./out/test/runUnitTests.js",
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.

Installing @playwright/test@latest at runtime with no lockfile means different CI runs can get different versions. If the intent is to always test against the newest Playwright, a comment explaining that would help. Otherwise, pinning to a major version (@playwright/test@^1) gives reproducibility without blocking upgrades.

await runCommand(window, 'MCP: Run Tool');
await selectFromQuickInput(window, MCP_SERVER_NAME);
await selectFromQuickInput(window, TOOL_NAME);
await fillCurrentQuickInput(window, 'test-subscription');
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.

tempRoot isn't cleaned up in the finally block. Adding await fs.rm(tempRoot, { recursive: true, force: true }); alongside app.close() prevents temp directory accumulation on CI agents.

Copy link
Copy Markdown
Contributor

@jongio jongio left a comment

Choose a reason for hiding this comment

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

Two new commits since my last review. The test now installs a test-only VS Code extension that auto-invokes a sensitive MCP tool on startup, rather than driving the command palette manually. This removes timing dependencies on the quick input widget and is more reliable for CI.

Other improvements:

  • Playwright tracing, screenshot, and HTML capture on failure for easier CI debugging
  • Frame-aware polling for the elicitation text (needed because VS Code renders webviews in iframes)
  • Pipeline artifact publishing via the 1ES template

My three prior comments are still open (backslash convention in PS script, Playwright version pinning, temp dir cleanup). No new issues in the incremental changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants