Skip to content

test(symfony): skip mcp provider chain tests without mcp-bundle - #8462

Merged
soyuka merged 1 commit into
api-platform:4.3from
soyuka:fix/mcp-extension-test-skip
Aug 16, 2026
Merged

test(symfony): skip mcp provider chain tests without mcp-bundle#8462
soyuka merged 1 commit into
api-platform:4.3from
soyuka:fix/mcp-extension-test-skip

Conversation

@soyuka

@soyuka soyuka commented Aug 16, 2026

Copy link
Copy Markdown
Member

Fixes the 7 api-platform/symfony component jobs that went red on 4.3 with d82766611 (#8457).

What broke

#8457 added two DI tests asserting the MCP provider chain is wired:

ApiPlatformExtensionTest::testMcpProviderChainIsSecuredAndValidatedWithSecurityBundle
ApiPlatformExtensionTest::testMcpProviderChainIsNotSecuredWithoutSecurityBundle
Service "api_platform.mcp.handler" not found.

They pass in the monorepo suite, where symfony/mcp-bundle is installed. The split api-platform/symfony package does not require it, so the extension's own gate

$mcpEnabled = ($config['mcp']['enabled'] ?? false) && class_exists(McpBundle::class) && ...

evaluates false there, no MCP service is registered, and both tests fail. The gap is that #8457 was only ever run against the monorepo suite.

Fix

Guard both tests on class_exists(McpBundle::class), mirroring the extension gate exactly, rather than asserting services that are correctly absent.

Verified the guard does not over-skip: with mcp-bundle installed both tests still execute and pass (2 tests, 17 assertions). The skip path itself is not reproducible locally — CI's split-package job is the verification.

Went from 3 failing jobs to 10 on 4.3; this should return it to 3. The remaining 3 (Symfony 8.1 / Symfony dev / Symfony lowest) are an unrelated pre-existing OpenApiCommandTest::testExecuteWithYaml failure.

The two tests added in api-platform#8457 assert api_platform.mcp.handler exists, but the
split api-platform/symfony package does not install symfony/mcp-bundle, so
$mcpEnabled is false there and no MCP service is registered. Guard both on
class_exists(McpBundle::class), mirroring the extension's own gate.
@soyuka
soyuka merged commit 393351e into api-platform:4.3 Aug 16, 2026
108 of 112 checks passed
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.

1 participant