Enable netfx testing. (#588)

* Enable netfx testing.

* Skip impacted tests and re-enable netfx testing.

* Remove redundant comment.

* Remove unnecessary project configuration.

* Simplify test server copying.
This commit is contained in:
Eirik Tsarpalis 2025-07-08 18:50:37 +03:00 • committed by GitHub
commit aa75f6f37e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@ namespace ModelContextProtocol.Tests;
public class StdioServerIntegrationTests(ITestOutputHelper testOutputHelper) : LoggedTest(testOutputHelper)
{
public static bool CanSendSigInt { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
public static bool CanSendSigInt { get; } = (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) && !PlatformDetection.IsMonoRuntime;
private const int SIGINT = 2;
[Fact(Skip = "Platform not supported by this test.", SkipUnless = nameof(CanSendSigInt))]
@ -46,9 +46,7 @@ public class StdioServerIntegrationTests(ITestOutputHelper testOutputHelper) : L
// https://github.com/dotnet/runtime/issues/109432, https://github.com/dotnet/runtime/issues/44944
Assert.Equal(0, kill(process.Id, SIGINT));
using var shutdownCts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
shutdownCts.CancelAfter(TimeSpan.FromSeconds(10));
await process.WaitForExitAsync(shutdownCts.Token);
await process.WaitForExitAsync(TimeSpan.FromSeconds(10));
Assert.True(process.HasExited);
Assert.Equal(0, process.ExitCode);