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:
parent
c0440760ac
commit
aa75f6f37e
2 changed files with 1940 additions and 53 deletions
|
|
@ -1,4 +1,6 @@
|
|||
namespace ModelContextProtocol.Tests.Utils;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace ModelContextProtocol.Tests.Utils;
|
||||
|
||||
public class MockHttpHandler : HttpMessageHandler
|
||||
{
|
||||
|
|
|
|||
15
tests/Common/Utils/ProcessExtensions.cs
Normal file
15
tests/Common/Utils/ProcessExtensions.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
namespace System.Diagnostics;
|
||||
|
||||
public static class ProcessExtensions
|
||||
{
|
||||
public static async Task WaitForExitAsync(this Process process, TimeSpan timeout)
|
||||
{
|
||||
#if NET
|
||||
using var shutdownCts = CancellationTokenSource.CreateLinkedTokenSource(TestContext.Current.CancellationToken);
|
||||
shutdownCts.CancelAfter(timeout);
|
||||
await process.WaitForExitAsync(shutdownCts.Token);
|
||||
#else
|
||||
process.WaitForExit(milliseconds: (int)timeout.TotalMilliseconds);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue