Repository: microsoft/semantic-kernel
File: dotnet/src/SemanticKernel.AotTests/Program.cs (C#)

Code before:
﻿// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using SemanticKernel.AotTests.UnitTests.Core.Functions;
using SemanticKernel.AotTests.UnitTests.Core.Plugins;
using SemanticKernel.AotTests.UnitTests.Search;

namespace SemanticKernel.AotTests;

/// <summary>
/// This application is created in accordance with the instructions in the blog post at https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries to ensure that
/// all Native-AOT-related warnings missed by the Roslyn analyzers are caught by the AOT compiler used in this application.
/// </summary>
internal sealed class Program
{
    private static async Task<int> Main(string[] args)
    {
        bool success = await RunUnitTestsAsync(s_unitTests);

        return success ? 1 : 0;
    }

    [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "Test application intentionally tests dynamic code paths. VectorStoreTextSearch LINQ filtering requires reflection for dynamic expression building from runtime filter specifications.")]
    private static readonly Func<Task>[] s_unitTests =
    [
        // Tests for functions
        KernelFunctionFromMethodTests.CreateUsingOverloadWithFunctionDetails,
        KernelFunctionFromMethodTests.CreateUsingOverloadWithOptions,
        KernelFunctionFromMethodTests.CreateMetadataUsingOverloadWithFunctionDetails,
        KernelFunctionFromMethodTests.CreateMetadataUsingOverloadWithOptions,

        KernelFunctionFactoryTests.CreateFromLambda,
        KernelFunctionFactoryTests.CreateFromMethod,
        KernelFunctionFactoryTests.CreateFromStringPrompt,
        KernelFunctionFactoryTests.CreateFromPromptTemplate,

        KernelExtensions_KernelFunctionTests.CreateFromLambda,
        KernelExtensions_KernelFunctionTests.CreateFromMethod,
        KernelExtensions_KernelFunctionTests.CreateFromStringPrompt,
        KernelExtensions_KernelFunctionTests.CreateFromPromptTemplate,

        KernelExtensions_InvokePromptTests.InvokePrompt,
        KernelExtensions_InvokePromptTests.InvokePromptStreaming,

        KernelFunctionMetadataFactoryTests.CreateFromType,

        // Tests for plugins
        KernelPluginFactoryTests.CreateFromGenericParameterType,

Review comment (suggestion):
We shouldn't suppress this here, since the intention with this code is to uncover native AOT incompatible code.
Since the changes is making the text search code explicitly native AOT incompatible, it's better to remove textsearch from these tests.

Code after:
﻿// Copyright (c) Microsoft. All rights reserved.

using SemanticKernel.AotTests.UnitTests.Core.Functions;
using SemanticKernel.AotTests.UnitTests.Core.Plugins;
using SemanticKernel.AotTests.UnitTests.Search;

namespace SemanticKernel.AotTests;

/// <summary>
/// This application is created in accordance with the instructions in the blog post at https://devblogs.microsoft.com/dotnet/creating-aot-compatible-libraries to ensure that
/// all Native-AOT-related warnings missed by the Roslyn analyzers are caught by the AOT compiler used in this application.
/// </summary>
internal sealed class Program
{
    private static async Task<int> Main(string[] args)
    {
        bool success = await RunUnitTestsAsync(s_unitTests);

        return success ? 1 : 0;
    }

    private static readonly Func<Task>[] s_unitTests =
    [
        // Tests for functions
        KernelFunctionFromMethodTests.CreateUsingOverloadWithFunctionDetails,
        KernelFunctionFromMethodTests.CreateUsingOverloadWithOptions,
        KernelFunctionFromMethodTests.CreateMetadataUsingOverloadWithFunctionDetails,
        KernelFunctionFromMethodTests.CreateMetadataUsingOverloadWithOptions,

        KernelFunctionFactoryTests.CreateFromLambda,
        KernelFunctionFactoryTests.CreateFromMethod,
        KernelFunctionFactoryTests.CreateFromStringPrompt,
        KernelFunctionFactoryTests.CreateFromPromptTemplate,

        KernelExtensions_KernelFunctionTests.CreateFromLambda,
        KernelExtensions_KernelFunctionTests.CreateFromMethod,
        KernelExtensions_KernelFunctionTests.CreateFromStringPrompt,
        KernelExtensions_KernelFunctionTests.CreateFromPromptTemplate,

        KernelExtensions_InvokePromptTests.InvokePrompt,
        KernelExtensions_InvokePromptTests.InvokePromptStreaming,

        KernelFunctionMetadataFactoryTests.CreateFromType,

        // Tests for plugins
        KernelPluginFactoryTests.CreateFromGenericParameterType,
        KernelPluginFactoryTests.CreateFromObject,