Co-authored-by: Tarek Mahmoud Sayed <tarekms@ntdev.microsoft.com>
This commit is contained in:
parent
3e7ca32130
commit
b2a40128fc
1 changed files with 168 additions and 10 deletions
|
|
@ -17,6 +17,7 @@ public class ClientConformanceTests
|
|||
// Public static property required for SkipUnless attribute
|
||||
public static bool IsNodeInstalled => NodeHelpers.IsNodeInstalled();
|
||||
public static bool HasSep2243Scenarios => NodeHelpers.HasSep2243Scenarios();
|
||||
public static bool HasConformantCustomHeadersScenario => NodeHelpers.HasConformantCustomHeadersScenario();
|
||||
|
||||
public ClientConformanceTests(ITestOutputHelper output)
|
||||
{
|
||||
|
|
@ -66,10 +67,6 @@ public class ClientConformanceTests
|
|||
[Theory(Skip = "SEP-2243 conformance scenarios not available (requires conformance package >= 0.2.0).", SkipUnless = nameof(HasSep2243Scenarios))]
|
||||
[InlineData("http-standard-headers")]
|
||||
[InlineData("http-invalid-tool-headers")]
|
||||
// Commented out: the upstream scenario annotates a "number"-typed parameter with x-mcp-header,
|
||||
// which SEP-2243 forbids, so the client rejects the tool and sends no Mcp-Param-* headers,
|
||||
// failing every positive check. Re-enable once a conformant conformance package ships (#1655).
|
||||
// [InlineData("http-custom-headers")]
|
||||
public async Task RunConformanceTest_Sep2243(string scenario)
|
||||
{
|
||||
// Run the conformance test suite
|
||||
|
|
@ -80,6 +77,23 @@ public class ClientConformanceTests
|
|||
$"Conformance test failed.\n\nStdout:\n{result.Output}\n\nStderr:\n{result.Error}");
|
||||
}
|
||||
|
||||
// The http-custom-headers scenario needs a tighter gate than the other SEP-2243 scenarios:
|
||||
// conformance 0.2.0-alpha.5 through 0.2.0-alpha.7 shipped it with an x-mcp-header on a
|
||||
// number-typed parameter (forbidden by SEP-2243), which a conformant client excludes,
|
||||
// failing every positive check. It was fixed upstream in 0.2.0-alpha.8 (conformance #371),
|
||||
// so require at least that version to avoid spurious failures on older 0.2.0 prereleases.
|
||||
[Theory(Skip = "Conformant http-custom-headers scenario not available (requires conformance package >= 0.2.0-alpha.8).", SkipUnless = nameof(HasConformantCustomHeadersScenario))]
|
||||
[InlineData("http-custom-headers")]
|
||||
public async Task RunConformanceTest_Sep2243_CustomHeaders(string scenario)
|
||||
{
|
||||
// Run the conformance test suite
|
||||
var result = await RunClientConformanceScenario(scenario);
|
||||
|
||||
// Report the results
|
||||
Assert.True(result.Success,
|
||||
$"Conformance test failed.\n\nStdout:\n{result.Output}\n\nStderr:\n{result.Error}");
|
||||
}
|
||||
|
||||
private async Task<(bool Success, string Output, string Error)> RunClientConformanceScenario(string scenario)
|
||||
{
|
||||
// Construct an absolute path to the conformance client executable
|
||||
|
|
|
|||
Loading…
Reference in a new issue