Turn on the AOT analyzer. (#92)

* Turn on the AOT analyzer.

* Address feedback

* Add missing types.

* Fix build and react to conflicts.

* Fix failing test.

* Address feedback.
This commit is contained in:
Eirik Tsarpalis 2025-03-18 18:48:28 +02:00 • committed by GitHub
commit e7fa6194f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 522 additions and 68 deletions

View file

@ -2,7 +2,6 @@
using McpDotNet.Protocol.Types;
using McpDotNet.Server;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Serilog;
using System.Text;

View file

@ -287,7 +287,7 @@ public class McpServerBuilderExtensionsToolsTests
var tool = result.Tools.First(t => t.Name == "TestTool");
Assert.Equal("TestTool", tool.Name);
Assert.Empty(tool.Description);
Assert.Empty(tool.Description!);
Assert.NotNull(tool.InputSchema);
Assert.Equal("object", tool.InputSchema.Type);
Assert.NotNull(tool.InputSchema.Properties);

View file

@ -603,7 +603,7 @@ public class McpServerTests
supportsSampling ? new ClientCapabilities { Sampling = new SamplingCapability() } :
null;
public async Task<T> SendRequestAsync<T>(JsonRpcRequest request, CancellationToken cancellationToken) where T : class
public Task<T> SendRequestAsync<T>(JsonRpcRequest request, CancellationToken cancellationToken) where T : class
{
CreateMessageRequestParams rp = Assert.IsType<CreateMessageRequestParams>(request.Params);
@ -627,7 +627,7 @@ public class McpServerTests
Role = "assistant",
StopReason = "endTurn",
};
return (T)(object)result;
return Task.FromResult((T)(object)result);
}
public ValueTask DisposeAsync() => default;

View file

@ -3,6 +3,7 @@ using McpDotNet.Configuration;
using McpDotNet.Protocol.Transport;
using Microsoft.Extensions.Logging;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace McpDotNet.Tests;
@ -37,6 +38,7 @@ public class SseServerIntegrationTestFixture : IDisposable
Start();
}
[MemberNotNull(nameof(_process))]
public void Start()
{
// Start the server (which is at TestSseServer.exe on windows and "dotnet TestSseServer.dll" on linux)