test(symfony): skip mcp provider chain tests without mcp-bundle - #8462
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the 7
api-platform/symfonycomponent jobs that went red on 4.3 withd82766611(#8457).What broke
#8457 added two DI tests asserting the MCP provider chain is wired:
They pass in the monorepo suite, where
symfony/mcp-bundleis installed. The splitapi-platform/symfonypackage does not require it, so the extension's own gateevaluates 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-existingOpenApiCommandTest::testExecuteWithYamlfailure.