From fe4dc4d3a8c5392ad2cb2bb542938c2ab935b042 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Fri, 24 Apr 2026 13:57:21 -0700 Subject: [PATCH 01/11] enable --- .../FoundryLocal.Tests/AudioClientTests.cs | 1 - .../ChatCompletionsTests.cs | 1 - sdk/cs/test/FoundryLocal.Tests/EndToEnd.cs | 1 - .../FoundryLocalManagerTest.cs | 1 - .../LiveAudioTranscriptionTests.cs | 3 -- .../FoundryLocal.Tests/SkipInCIAttribute.cs | 19 ----------- .../SkipUnlessIntegrationAttribute.cs | 20 ----------- .../SkipUnlessIntegrationTests.cs | 34 ------------------- 8 files changed, 80 deletions(-) delete mode 100644 sdk/cs/test/FoundryLocal.Tests/SkipInCIAttribute.cs delete mode 100644 sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationAttribute.cs delete mode 100644 sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationTests.cs diff --git a/sdk/cs/test/FoundryLocal.Tests/AudioClientTests.cs b/sdk/cs/test/FoundryLocal.Tests/AudioClientTests.cs index 0a0488116..4466c5fad 100644 --- a/sdk/cs/test/FoundryLocal.Tests/AudioClientTests.cs +++ b/sdk/cs/test/FoundryLocal.Tests/AudioClientTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.AI.Foundry.Local.Tests; using System.Threading.Tasks; -[SkipUnlessIntegration] internal sealed class AudioClientTests { private static IModel? model; diff --git a/sdk/cs/test/FoundryLocal.Tests/ChatCompletionsTests.cs b/sdk/cs/test/FoundryLocal.Tests/ChatCompletionsTests.cs index 21578147b..7e70c6836 100644 --- a/sdk/cs/test/FoundryLocal.Tests/ChatCompletionsTests.cs +++ b/sdk/cs/test/FoundryLocal.Tests/ChatCompletionsTests.cs @@ -13,7 +13,6 @@ namespace Microsoft.AI.Foundry.Local.Tests; using Betalgo.Ranul.OpenAI.ObjectModels.ResponseModels; using Betalgo.Ranul.OpenAI.ObjectModels.SharedModels; -[SkipUnlessIntegration] internal sealed class ChatCompletionsTests { private static IModel? model; diff --git a/sdk/cs/test/FoundryLocal.Tests/EndToEnd.cs b/sdk/cs/test/FoundryLocal.Tests/EndToEnd.cs index 1b4019bac..56c707691 100644 --- a/sdk/cs/test/FoundryLocal.Tests/EndToEnd.cs +++ b/sdk/cs/test/FoundryLocal.Tests/EndToEnd.cs @@ -8,7 +8,6 @@ namespace Microsoft.AI.Foundry.Local.Tests; using System; using System.Threading.Tasks; -[SkipUnlessIntegration] internal sealed class EndToEnd { // end-to-end using real catalog. run manually as a standalone test as it alters the model cache. diff --git a/sdk/cs/test/FoundryLocal.Tests/FoundryLocalManagerTest.cs b/sdk/cs/test/FoundryLocal.Tests/FoundryLocalManagerTest.cs index 2aa29d18d..cd7e77932 100644 --- a/sdk/cs/test/FoundryLocal.Tests/FoundryLocalManagerTest.cs +++ b/sdk/cs/test/FoundryLocal.Tests/FoundryLocalManagerTest.cs @@ -11,7 +11,6 @@ namespace Microsoft.AI.Foundry.Local.Tests; using Microsoft.AI.Foundry.Local; using Microsoft.AI.Foundry.Local.Detail; -[SkipUnlessIntegration] public class FoundryLocalManagerTests { [Test] diff --git a/sdk/cs/test/FoundryLocal.Tests/LiveAudioTranscriptionTests.cs b/sdk/cs/test/FoundryLocal.Tests/LiveAudioTranscriptionTests.cs index 3c56fc514..07fd67ea2 100644 --- a/sdk/cs/test/FoundryLocal.Tests/LiveAudioTranscriptionTests.cs +++ b/sdk/cs/test/FoundryLocal.Tests/LiveAudioTranscriptionTests.cs @@ -133,7 +133,6 @@ public async Task CoreErrorResponse_TryParse_TransientError() // --- Session state guard tests --- [Test] - [SkipUnlessIntegration] public async Task AppendAsync_BeforeStart_Throws() { await using var session = new LiveAudioTranscriptionSession("test-model"); @@ -153,7 +152,6 @@ public async Task AppendAsync_BeforeStart_Throws() } [Test] - [SkipUnlessIntegration] public async Task GetTranscriptionStream_BeforeStart_Throws() { await using var session = new LiveAudioTranscriptionSession("test-model"); @@ -177,7 +175,6 @@ public async Task GetTranscriptionStream_BeforeStart_Throws() // --- E2E streaming test with synthetic PCM audio --- [Test] - [SkipUnlessIntegration] public async Task LiveStreaming_E2E_WithSyntheticPCM_ReturnsValidResponse() { diff --git a/sdk/cs/test/FoundryLocal.Tests/SkipInCIAttribute.cs b/sdk/cs/test/FoundryLocal.Tests/SkipInCIAttribute.cs deleted file mode 100644 index c4d17e5b9..000000000 --- a/sdk/cs/test/FoundryLocal.Tests/SkipInCIAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace Microsoft.AI.Foundry.Local.Tests; - -using TUnit.Core; - -using System.Threading.Tasks; - -public class SkipInCIAttribute() : SkipAttribute("This test is only supported locally. Skipped on CIs.") -{ - public override Task ShouldSkip(TestRegisteredContext context) - { - return Task.FromResult(Utils.IsRunningInCI()); - } -} diff --git a/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationAttribute.cs b/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationAttribute.cs deleted file mode 100644 index 7125c7654..000000000 --- a/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace Microsoft.AI.Foundry.Local.Tests; - -using TUnit.Core; - -using System.Threading.Tasks; - -public class SkipUnlessIntegrationAttribute() - : SkipAttribute("Integration test infrastructure not available. See LOCAL_MODEL_TESTING.md for setup instructions.") -{ - public override Task ShouldSkip(TestRegisteredContext context) - { - return Task.FromResult(!Utils.IntegrationTestsAvailable); - } -} diff --git a/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationTests.cs b/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationTests.cs deleted file mode 100644 index 1d882bdbb..000000000 --- a/sdk/cs/test/FoundryLocal.Tests/SkipUnlessIntegrationTests.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// Copyright (c) Microsoft. All rights reserved. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace Microsoft.AI.Foundry.Local.Tests; - -using System.Threading.Tasks; - -internal sealed class SkipUnlessIntegrationTests -{ - [Test] - public async Task ShouldSkip_ReturnsTrue_WhenIntegrationTestsNotAvailable() - { - // IntegrationTestsAvailable is set during assembly init. - // Without test-data-shared, it will be false and ShouldSkip returns true. - // With test-data-shared, it will be true and ShouldSkip returns false. - // Either way, it should be the inverse of IntegrationTestsAvailable. - - var attr = new SkipUnlessIntegrationAttribute(); - var shouldSkip = await attr.ShouldSkip(null!); - - await Assert.That(shouldSkip).IsEqualTo(!Utils.IntegrationTestsAvailable); - } - - [Test] - public async Task SkipReason_ContainsSetupInstructions() - { - var attr = new SkipUnlessIntegrationAttribute(); - - await Assert.That(attr.Reason).Contains("LOCAL_MODEL_TESTING.md"); - } -} From 64a2091415da88f59559603b5a2f8a56b7a15912 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Fri, 24 Apr 2026 15:56:00 -0700 Subject: [PATCH 02/11] SkipUnlessIntegration --- sdk/cs/test/FoundryLocal.Tests/EmbeddingClientTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/cs/test/FoundryLocal.Tests/EmbeddingClientTests.cs b/sdk/cs/test/FoundryLocal.Tests/EmbeddingClientTests.cs index bed3a8ea5..a5123cb04 100644 --- a/sdk/cs/test/FoundryLocal.Tests/EmbeddingClientTests.cs +++ b/sdk/cs/test/FoundryLocal.Tests/EmbeddingClientTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.AI.Foundry.Local.Tests; using System.Threading.Tasks; -[SkipUnlessIntegration] internal sealed class EmbeddingClientTests { private static IModel? model; From 97dc92b0c620ece6643666745026f268c97a2e11 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 27 Apr 2026 10:03:53 -0700 Subject: [PATCH 03/11] flc ref --- sdk/cs/src/Microsoft.AI.Foundry.Local.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj index 384b44151..f47e23756 100644 --- a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj +++ b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj @@ -107,6 +107,10 @@ + + + + From e759a86ec3c1013a841075334b277d73752327a3 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 27 Apr 2026 11:28:18 -0700 Subject: [PATCH 04/11] UseCurrentRuntimeIdentifier --- sdk/cs/src/Microsoft.AI.Foundry.Local.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj index f47e23756..93d2b7769 100644 --- a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj +++ b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj @@ -15,6 +15,8 @@ git net8.0;netstandard2.0 + + false true enable True From 7c59016bcd0d763f9fc8fcd453592dd0d63aee86 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 27 Apr 2026 13:31:37 -0700 Subject: [PATCH 05/11] rids --- sdk/cs/src/Microsoft.AI.Foundry.Local.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj index 93d2b7769..588da1e90 100644 --- a/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj +++ b/sdk/cs/src/Microsoft.AI.Foundry.Local.csproj @@ -15,8 +15,7 @@ git net8.0;netstandard2.0 - - false + win-x64;win-arm64;linux-x64;osx-arm64 true enable True From 9177059437afa37218552a070679e8bc7c4dcaf6 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Tue, 28 Apr 2026 11:52:37 -0700 Subject: [PATCH 06/11] fix --- .../FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj index 5280da424..94e54532d 100644 --- a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj +++ b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj @@ -20,7 +20,7 @@ explicitly so restore and build agree. --> - win-x64 + $(NETCoreSdkRuntimeIdentifier) From 9598d3b517ad39bc272c7078e17501ea8caa73a8 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Wed, 29 Apr 2026 12:00:58 -0700 Subject: [PATCH 07/11] direct ref --- .../Microsoft.AI.Foundry.Local.Tests.csproj | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj index 94e54532d..d993969ee 100644 --- a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj +++ b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj @@ -18,11 +18,34 @@ .NET Framework test executables default to Prefer32Bit=true, causing the build to look for a RID-specific target that restore doesn't generate. Set RuntimeIdentifier explicitly so restore and build agree. + + Also read the Core package version so we can add a direct PackageReference for net462. + NuGet build/ targets that copy native libraries only fire for direct consumers. + Since this project references the SDK via ProjectReference (transitive), the native + DLLs (Core, onnxruntime, onnxruntime-genai) are not copied to the output without this. + net8.0 does not need this because the runtime probes runtimes//native/ automatically. --> $(NETCoreSdkRuntimeIdentifier) + <_DepsVersionsPath>$(MSBuildThisFileDirectory)..\..\..\deps_versions.json + <_DepsVersionsJson Condition="Exists('$(_DepsVersionsPath)')">$([System.IO.File]::ReadAllText('$(_DepsVersionsPath)')) + $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"nuget"\s*:\s*"([^"]+)"').Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"onnxruntime"[^}]*"version"\s*:\s*"([^"]+)"').Groups[1].Value) + $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"onnxruntime-genai"[^}]*"version"\s*:\s*"([^"]+)"').Groups[1].Value) + + + + + + + net8.0-windows10.0.26100.0; 10.0.17763.0 From 33a86558a28f3f144f82d455fc754f316a80d329 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Thu, 30 Apr 2026 16:17:15 -0700 Subject: [PATCH 08/11] fix --- sdk/cs/src/Detail/CoreInterop.cs | 2 +- .../Microsoft.AI.Foundry.Local.Tests.csproj | 27 ++----------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/sdk/cs/src/Detail/CoreInterop.cs b/sdk/cs/src/Detail/CoreInterop.cs index 7239a48e4..09b02b426 100644 --- a/sdk/cs/src/Detail/CoreInterop.cs +++ b/sdk/cs/src/Detail/CoreInterop.cs @@ -16,7 +16,7 @@ namespace Microsoft.AI.Foundry.Local.Detail; internal partial class CoreInterop : ICoreInterop { // TODO: Android and iOS may need special handling. See ORT C# NativeMethods.shared.cs - internal const string LibraryName = "Microsoft.AI.Foundry.Local.Core"; + internal const string LibraryName = "Microsoft.AI.Foundry.Local.Core.dll"; private readonly ILogger _logger; diff --git a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj index d993969ee..1cb72bc1a 100644 --- a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj +++ b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj @@ -18,34 +18,11 @@ .NET Framework test executables default to Prefer32Bit=true, causing the build to look for a RID-specific target that restore doesn't generate. Set RuntimeIdentifier explicitly so restore and build agree. - - Also read the Core package version so we can add a direct PackageReference for net462. - NuGet build/ targets that copy native libraries only fire for direct consumers. - Since this project references the SDK via ProjectReference (transitive), the native - DLLs (Core, onnxruntime, onnxruntime-genai) are not copied to the output without this. - net8.0 does not need this because the runtime probes runtimes//native/ automatically. --> - $(NETCoreSdkRuntimeIdentifier) - <_DepsVersionsPath>$(MSBuildThisFileDirectory)..\..\..\deps_versions.json - <_DepsVersionsJson Condition="Exists('$(_DepsVersionsPath)')">$([System.IO.File]::ReadAllText('$(_DepsVersionsPath)')) - $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"nuget"\s*:\s*"([^"]+)"').Groups[1].Value) - $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"onnxruntime"[^}]*"version"\s*:\s*"([^"]+)"').Groups[1].Value) - $([System.Text.RegularExpressions.Regex]::Match('$(_DepsVersionsJson)', '"onnxruntime-genai"[^}]*"version"\s*:\s*"([^"]+)"').Groups[1].Value) + win-x64 - - - - - - - net8.0-windows10.0.26100.0; 10.0.17763.0 @@ -81,4 +58,4 @@ - + \ No newline at end of file From 2e8f3030c21397745898d9ed21b00a1e02c775d0 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Thu, 30 Apr 2026 16:17:51 -0700 Subject: [PATCH 09/11] fmt --- .../FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj index 1cb72bc1a..5280da424 100644 --- a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj +++ b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj @@ -58,4 +58,4 @@ - \ No newline at end of file + From 5d7a87c3ec336ac678e1de21f0b3a97f105df115 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 4 May 2026 09:16:24 -0700 Subject: [PATCH 10/11] flatten dlls --- .../Microsoft.AI.Foundry.Local.Tests.csproj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj index 5280da424..8e39fa649 100644 --- a/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj +++ b/sdk/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj @@ -23,6 +23,13 @@ win-x64 + + + $(NETCoreSdkRuntimeIdentifier) + + net8.0-windows10.0.26100.0; 10.0.17763.0 From 0578b7cfc027ecff35af9d926fbfd78b678870b3 Mon Sep 17 00:00:00 2001 From: Prathik Rao Date: Mon, 4 May 2026 09:17:09 -0700 Subject: [PATCH 11/11] rev --- sdk/cs/src/Detail/CoreInterop.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cs/src/Detail/CoreInterop.cs b/sdk/cs/src/Detail/CoreInterop.cs index 09b02b426..7239a48e4 100644 --- a/sdk/cs/src/Detail/CoreInterop.cs +++ b/sdk/cs/src/Detail/CoreInterop.cs @@ -16,7 +16,7 @@ namespace Microsoft.AI.Foundry.Local.Detail; internal partial class CoreInterop : ICoreInterop { // TODO: Android and iOS may need special handling. See ORT C# NativeMethods.shared.cs - internal const string LibraryName = "Microsoft.AI.Foundry.Local.Core.dll"; + internal const string LibraryName = "Microsoft.AI.Foundry.Local.Core"; private readonly ILogger _logger;