Skip to content

Fix E2E tests to use namespaced tool names and handle wrapped API responses#27

Merged
rothnic merged 3 commits intomainfrom
copilot/fix-build-workflow-errors
Nov 19, 2025
Merged

Fix E2E tests to use namespaced tool names and handle wrapped API responses#27
rothnic merged 3 commits intomainfrom
copilot/fix-build-workflow-errors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 19, 2025

E2E tests failed because they used pre-namespace tool names and expected raw JSON responses, but the generated MCP server uses namespaced tools (e.g., settings_system_backendVersion) and wraps responses in "API Response (Status: XXX):\n{...}" format.

Changes

Tool name updates:

  • Updated all tool invocations to use namespaced format generated by openapi-mcp-generator
  • backendVersionsettings_system_backendVersion
  • listJobsjob_list_listJobs
  • getUseruser_profile_whoami
  • listWorkspacesworkspace_list_listUserWorkspaces
  • Plus 4 other tools updated similarly

Response parsing:

  • Added regex extraction for wrapped JSON: /API Response \(Status: \d+\):\n([\s\S]*)/
  • Handle plain text responses (e.g., version endpoint returns "CE v1.580.0...")
  • Removed checks for non-existent isError property

Data structure fixes:

  • Workspace listing returns { email, workspaces: [] } not an array
  • Scripts don't include workspace_id field

Example change:

// Before
const response = await mcpClient.request({
  method: "tools/call",
  params: { name: "listJobs", arguments: { workspace } }
});
const result = JSON.parse(response.content[0].text);

// After
const response = await mcpClient.request({
  method: "tools/call",
  params: { name: "job_list_listJobs", arguments: { workspace } }
});
const resultText = response.content[0].text;
const jsonMatch = resultText.match(/API Response \(Status: \d+\):\n([\s\S]*)/);
const result = jsonMatch ? JSON.parse(jsonMatch[1]) : null;

Tests: 27/27 passing (was 12 failures)

Original prompt

This section details on the original issue you should resolve

<issue_title>Build workflow failed for latest version after recent changs</issue_title>
<issue_description>See https://github.com/rothnic/windmill-mcp/actions/runs/19509122419/job/55843726100

Notes:

  • The build should fail if the integration tests don't pass

Key things to review:

  • are the env variables all setup and available for running the integration tests (maybe the github project needs env variables added, or should they just be set in the workflow since they aren't secret, they are just for testing)</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI and others added 2 commits November 19, 2025 16:55
Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
…se formats

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build workflow failure due to integration tests Fix E2E tests to use namespaced tool names and handle wrapped API responses Nov 19, 2025
Copilot AI requested a review from rothnic November 19, 2025 17:07
@rothnic rothnic marked this pull request as ready for review November 19, 2025 17:12
@rothnic rothnic merged commit eeec6df into main Nov 19, 2025
6 checks passed
@rothnic rothnic deleted the copilot/fix-build-workflow-errors branch November 19, 2025 18:27
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.

Build workflow failed for latest version after recent changs

2 participants