Add foundational MCP unit test suite - #11643
Open
kitsupanic wants to merge 1 commit into
Open
Conversation
43 tests in Sandbox.Test.Engine covering ToolRegistry schema generation (comma-string vector rule, optional-by-default params, Range to min/max, readOnlyHint), argument binding (unknown-arg suggestions, case-insensitivity, range clamping, json-in-string unwrapping), McpResult serialization including GameObjectRef/ComponentRef collapse against a headless scene, and registry surface (toolset naming, duplicate-name skip). Fixture toolset declared in the test assembly; no production changes.
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.
Summary
Foundational unit test suite for the MCP layer, 43 tests, no production changes.
Motivation & Context
Per #11641: tool schemas and binding behaviour are permanent public API for MCP clients and nothing would catch a regression. The harness was already wired (all test tiers reference Sandbox.Tools, InternalsVisibleTo already granted).
Fixes: #11641
Implementation Details
Tests live in Sandbox.Test.Engine (which builds EditorTypeLibrary and supports headless Scenes). A fixture
[McpToolset]declared in the test assembly is what the suite exercises, keeping it independent of real editor tools.MainThread.Queueruns inline on a main-marked thread so full ToolRegistry.Invoke round-trips run synchronously.Areas covered:
Verified locally — 43/43 new tests pass and the full Sandbox.Test.Engine run (TestCategory!=LiveBackend, same filter CI uses) passes 1760/1760 with the suite present.
Honest limitation — addon-side scene tools remain untestable headless (SceneEditorSession's ctor creates a Qt dock), per the note in #11641.
Screenshots / Videos (if applicable)
None — this is a unit test suite.
Checklist