From 934435d1fd85a979c62c9c0c8d05fd24f8b3c2cd Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 5 Jul 2026 23:23:04 +0100 Subject: [PATCH 1/2] test OK --- test/isn.tests/PushTest.cs | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/test/isn.tests/PushTest.cs b/test/isn.tests/PushTest.cs index 1871ebf..10afadc 100644 --- a/test/isn.tests/PushTest.cs +++ b/test/isn.tests/PushTest.cs @@ -208,7 +208,7 @@ namespace Isn.tests public void TestPush() { Program.LoadConfig(); - var report = Program.PushPkg(new[] { Path.Combine(AppContext.BaseDirectory, "dummy.nupkg") }); + var report = Program.PushPkg(new[] { GetDummyPackagePath() }); Assert.NotNull(report); Assert.Single(report); } @@ -222,7 +222,7 @@ namespace Isn.tests Program.SaveConfig(); Program.LoadConfig(); - var report = Program.PushPkg(new[] { Path.Combine(AppContext.BaseDirectory, "dummy.nupkg") }); + var report = Program.PushPkg(new[] { GetDummyPackagePath() }); Assert.NotNull(report); Assert.Single(report); @@ -238,5 +238,33 @@ namespace Isn.tests var pub = model.Resources.FirstOrDefault(r => r.Type.StartsWith("PackagePublish/")); Assert.True(pub != null); } + + private static string GetDummyPackagePath() + { + var localOutputDummy = Path.Combine(AppContext.BaseDirectory, "dummy.nupkg"); + if (File.Exists(localOutputDummy)) + { + return localOutputDummy; + } + + var dir = new DirectoryInfo(AppContext.BaseDirectory); + while (dir != null) + { + if (File.Exists(Path.Combine(dir.FullName, "isn.sln"))) + { + var sharedArtifact = Path.Combine(dir.FullName, "test", "data", "nuget-artifacts", "dummy.nuget.1.0.0.nupkg"); + if (File.Exists(sharedArtifact)) + { + return sharedArtifact; + } + + break; + } + + dir = dir.Parent; + } + + throw new FileNotFoundException("Unable to locate a dummy NuGet package for push tests."); + } } } \ No newline at end of file From ac0a195b5fa3a40eb66cef7b91a025fc6fcc3fea Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 5 Jul 2026 23:26:24 +0100 Subject: [PATCH 2/2] code cleanup --- test/data/test-isn/testcmd | 1 - test/isn.tests/PushTest.cs | 1 - test/isnd.tests/UnitTestWebHost.cs | 1 - 3 files changed, 3 deletions(-) delete mode 100644 test/data/test-isn/testcmd diff --git a/test/data/test-isn/testcmd b/test/data/test-isn/testcmd deleted file mode 100644 index 2127221..0000000 --- a/test/data/test-isn/testcmd +++ /dev/null @@ -1 +0,0 @@ -nuget install -NoCache -Verbosity detailed -ConfigFile ANuGet.Config Yavsc.Abstract diff --git a/test/isn.tests/PushTest.cs b/test/isn.tests/PushTest.cs index 10afadc..bc985ed 100644 --- a/test/isn.tests/PushTest.cs +++ b/test/isn.tests/PushTest.cs @@ -9,7 +9,6 @@ using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; using Xunit; -using isnd.Entities; using Isn.Abstract; namespace Isn.tests diff --git a/test/isnd.tests/UnitTestWebHost.cs b/test/isnd.tests/UnitTestWebHost.cs index c71b5ea..e7386e8 100644 --- a/test/isnd.tests/UnitTestWebHost.cs +++ b/test/isnd.tests/UnitTestWebHost.cs @@ -17,7 +17,6 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -using NuGet.Common; using NuGet.Configuration; using NuGet.Protocol; using NuGet.Protocol.Core.Types;