From 6602d54956ea51b12a071a613f52807164bc681c Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Tue, 28 May 2024 20:28:05 -0700 Subject: [PATCH 1/2] Get Version3X branch building --- cake/package-definitions.cake | 13 +---- cake/package-tests.cake | 56 +++++++++---------- msi/nunit/engine-files.wxi | 18 +++--- .../nunit.console-runner.netcore.nuspec | 3 +- .../nunit.engine.core.csproj | 1 + 5 files changed, 41 insertions(+), 50 deletions(-) diff --git a/cake/package-definitions.cake b/cake/package-definitions.cake index f8786f0c7..363b00130 100644 --- a/cake/package-definitions.cake +++ b/cake/package-definitions.cake @@ -25,32 +25,21 @@ public void InitializePackageDefinitions(ICakeContext context) Net40Test, Net40X86Test, Net35PlusNet40Test, - NetCore21Test, NetCore31Test, Net50Test, Net60Test, - NetCore21PlusNetCore31Test, - NetCore21PlusNetCore31PlusNet50PlusNet60Test, + Net50PlusNet60Test, Net40PlusNet60Test }; - if (dotnetX86Available) - { - StandardRunnerTests.Add(NetCore21X86Test); - StandardRunnerTests.Add(NetCore31X86Test); - } - // Tests run for the NETCORE runner package var NetCoreRunnerTests = new List { - NetCore21Test, NetCore31Test, Net50Test, Net60Test, Net70Test, Net80Test, - NetCore21PlusNetCore31Test, - NetCore21PlusNetCore31PlusNet50PlusNet60Test }; AllPackages.AddRange(new PackageDefinition[] { diff --git a/cake/package-tests.cake b/cake/package-tests.cake index 4683be511..58ab79dd0 100644 --- a/cake/package-tests.cake +++ b/cake/package-tests.cake @@ -72,35 +72,35 @@ static PackageTest NetCore31Test = new PackageTest( "netcoreapp3.1/mock-assembly.dll", MockAssemblyExpectedResult(1)); -static PackageTest NetCore31X86Test = new PackageTest( - "NetCore31X86Test", - "Run mock-assembly-x86.dll under .NET Core 3.1", - "netcoreapp3.1/mock-assembly-x86.dll", - MockAssemblyExpectedResult(1)); - -static PackageTest NetCore21Test = new PackageTest( - "NetCore21Test", - "Run mock-assembly.dll targeting .NET Core 2.1", - "netcoreapp2.1/mock-assembly.dll", - MockAssemblyExpectedResult(1)); - -static PackageTest NetCore21X86Test = new PackageTest( - "NetCore21X86Test", - "Run mock-assembly-x86.dll under .NET Core 2.1", - "netcoreapp2.1/mock-assembly-x86.dll", - MockAssemblyExpectedResult(1)); - -static PackageTest NetCore21PlusNetCore31Test = new PackageTest( - "NetCore21PlusNetCore31Test", - "Run two copies of mock-assembly together", - "netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll", - MockAssemblyExpectedResult(2)); - -static PackageTest NetCore21PlusNetCore31PlusNet50PlusNet60Test = new PackageTest( - "NetCore21PlusNetCore31PlusNet50PlusNet60Test", +//static PackageTest NetCore31X86Test = new PackageTest( +// "NetCore31X86Test", +// "Run mock-assembly-x86.dll under .NET Core 3.1", +// "netcoreapp3.1/mock-assembly-x86.dll", +// MockAssemblyExpectedResult(1)); + +//static PackageTest NetCore21Test = new PackageTest( +// "NetCore21Test", +// "Run mock-assembly.dll targeting .NET Core 2.1", +// "netcoreapp2.1/mock-assembly.dll", +// MockAssemblyExpectedResult(1)); + +//static PackageTest NetCore21X86Test = new PackageTest( +// "NetCore21X86Test", +// "Run mock-assembly-x86.dll under .NET Core 2.1", +// "netcoreapp2.1/mock-assembly-x86.dll", +// MockAssemblyExpectedResult(1)); + +//static PackageTest NetCore21PlusNetCore31Test = new PackageTest( +// "NetCore21PlusNetCore31Test", +// "Run two copies of mock-assembly together", +// "netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll", +// MockAssemblyExpectedResult(2)); + +static PackageTest Net50PlusNet60Test = new PackageTest( + "Net50PlusNet60Test", "Run four copies of mock-assembly together", - "netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll net5.0/mock-assembly.dll net6.0/mock-assembly.dll net7.0/mock-assembly.dll net8.0/mock-assembly.dll", - MockAssemblyExpectedResult(4)); + "net5.0/mock-assembly.dll net6.0/mock-assembly.dll",//" net7.0/mock-assembly.dll net8.0/mock-assembly.dll", + MockAssemblyExpectedResult(2)); static PackageTest Net40PlusNet60Test = new PackageTest( "Net40PlusNet60Test", diff --git a/msi/nunit/engine-files.wxi b/msi/nunit/engine-files.wxi index eb681e215..6422781b5 100644 --- a/msi/nunit/engine-files.wxi +++ b/msi/nunit/engine-files.wxi @@ -94,9 +94,9 @@ + Source="$(var.InstallImage)bin/agents/netcoreapp3.1/nunit-agent.dll" /> + Source="$(var.InstallImage)bin/agents/netcoreapp3.1/nunit-agent.dll.config" /> + Source="$(var.InstallImage)bin/agents/netcoreapp3.1/Microsoft.Extensions.DependencyModel.dll" /> + Source="$(var.InstallImage)bin/agents/net5.0/nunit-agent.dll" /> + Source="$(var.InstallImage)bin/agents/net5.0/nunit-agent.dll.config" /> + Source="$(var.InstallImage)bin/agents/net6.0/nunit-agent.dll" /> + Source="$(var.InstallImage)bin/agents/net6.0/nunit-agent.dll.config" /> + Source="$(var.InstallImage)bin/agents/net6.0/nunit-agent.deps.json" /> + Source="$(var.InstallImage)bin/agents/net6.0/nunit-agent.runtimeconfig.json" /> - + @@ -61,6 +61,7 @@ + diff --git a/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj b/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj index f47de9dfd..b40bd5cb9 100644 --- a/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj +++ b/src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj @@ -8,6 +8,7 @@ ..\..\nunit.snk portable true + true From ad036512658d9b93a0edfc320d7f5910db404235 Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Wed, 29 May 2024 03:00:33 -0700 Subject: [PATCH 2/2] Fix version3X HEAD so it builds --- build.cake | 10 +++---- cake/package-definitions.cake | 1 - cake/package-tests.cake | 26 +------------------ .../Services/ExtensionManagerTests.cs | 4 +-- .../nunit.engine.core.tests.csproj | 2 +- .../nunit.engine.tests.csproj | 4 +-- 6 files changed, 9 insertions(+), 38 deletions(-) diff --git a/build.cake b/build.cake index d882731aa..498be2407 100644 --- a/build.cake +++ b/build.cake @@ -114,11 +114,6 @@ public void BuildSolution() .WithProperty("TargetFramework", "netstandard2.0") .WithProperty("PublishDir", BIN_DIR + "netstandard2.0")); - DisplayBanner("Publishing ENGINE TESTS Project for NETCOREAPP2.1"); - MSBuild(ENGINE_TESTS_PROJECT, CreateMSBuildSettings("Publish") - .WithProperty("TargetFramework", "netcoreapp2.1") - .WithProperty("PublishDir", BIN_DIR + "netcoreapp2.1")); - // TODO: May not be needed foreach (var framework in new[] { "netcoreapp3.1", "net5.0" }) { @@ -129,6 +124,7 @@ public void BuildSolution() } } +// TODO: Test this on linux to see if changes are needed private void BuildEachProjectSeparately() { DotNetRestore(SOLUTION_FILE); @@ -237,7 +233,7 @@ Task("TestNetStandard20EngineCore") .OnError(exception => { UnreportedErrors.Add(exception.Message); }) .Does(() => { - RunDotnetNUnitLiteTests(NETCORE_ENGINE_CORE_TESTS, "netcoreapp2.1"); + RunDotnetNUnitLiteTests(NETCORE_ENGINE_CORE_TESTS, "netcoreapp3.1"); }); ////////////////////////////////////////////////////////////////////// @@ -302,7 +298,7 @@ Task("TestNetStandard20Engine") .OnError(exception => { UnreportedErrors.Add(exception.Message); }) .Does(() => { - RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp2.1"); + RunDotnetNUnitLiteTests(NETCORE_ENGINE_TESTS, "netcoreapp3.1"); }); ////////////////////////////////////////////////////////////////////// diff --git a/cake/package-definitions.cake b/cake/package-definitions.cake index 363b00130..04f431216 100644 --- a/cake/package-definitions.cake +++ b/cake/package-definitions.cake @@ -151,7 +151,6 @@ public void InitializePackageDefinitions(ICakeContext context) HasDirectory("bin/net20").WithFiles(CONSOLE_FILES).AndFiles(ENGINE_FILES).AndFile("nunit3-console.pdb").AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/net35").WithFiles(CONSOLE_FILES).AndFiles(ENGINE_FILES).AndFile("nunit3-console.pdb").AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/netstandard2.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), - HasDirectory("bin/netcoreapp2.1").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/netcoreapp3.1").WithFiles(ENGINE_CORE_FILES).AndFiles(ENGINE_CORE_PDB_FILES), //HasDirectory("bin/net5.0").WithFiles(ENGINE_FILES).AndFiles(ENGINE_PDB_FILES), HasDirectory("bin/agents/net20").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES), diff --git a/cake/package-tests.cake b/cake/package-tests.cake index 58ab79dd0..26eee6af3 100644 --- a/cake/package-tests.cake +++ b/cake/package-tests.cake @@ -72,33 +72,9 @@ static PackageTest NetCore31Test = new PackageTest( "netcoreapp3.1/mock-assembly.dll", MockAssemblyExpectedResult(1)); -//static PackageTest NetCore31X86Test = new PackageTest( -// "NetCore31X86Test", -// "Run mock-assembly-x86.dll under .NET Core 3.1", -// "netcoreapp3.1/mock-assembly-x86.dll", -// MockAssemblyExpectedResult(1)); - -//static PackageTest NetCore21Test = new PackageTest( -// "NetCore21Test", -// "Run mock-assembly.dll targeting .NET Core 2.1", -// "netcoreapp2.1/mock-assembly.dll", -// MockAssemblyExpectedResult(1)); - -//static PackageTest NetCore21X86Test = new PackageTest( -// "NetCore21X86Test", -// "Run mock-assembly-x86.dll under .NET Core 2.1", -// "netcoreapp2.1/mock-assembly-x86.dll", -// MockAssemblyExpectedResult(1)); - -//static PackageTest NetCore21PlusNetCore31Test = new PackageTest( -// "NetCore21PlusNetCore31Test", -// "Run two copies of mock-assembly together", -// "netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll", -// MockAssemblyExpectedResult(2)); - static PackageTest Net50PlusNet60Test = new PackageTest( "Net50PlusNet60Test", - "Run four copies of mock-assembly together", + "Run mock-assembly under .NET 5.0 and 6.0 together", "net5.0/mock-assembly.dll net6.0/mock-assembly.dll",//" net7.0/mock-assembly.dll net8.0/mock-assembly.dll", MockAssemblyExpectedResult(2)); diff --git a/src/NUnitEngine/nunit.engine.core.tests/Services/ExtensionManagerTests.cs b/src/NUnitEngine/nunit.engine.core.tests/Services/ExtensionManagerTests.cs index d0bd6a3f3..86b3b59bc 100644 --- a/src/NUnitEngine/nunit.engine.core.tests/Services/ExtensionManagerTests.cs +++ b/src/NUnitEngine/nunit.engine.core.tests/Services/ExtensionManagerTests.cs @@ -153,7 +153,7 @@ public void SkipsGracefullyLoadingOtherFrameworkExtensionAssembly() var assemblyName = Path.Combine(GetSiblingDirectory("net35"), "nunit.engine.core.tests.exe"); #else // Attempt to load the .NET Core 2.1 version of the extensions from the .NET 3.5 tests - var assemblyName = Path.Combine(GetSiblingDirectory("netcoreapp2.1"), "nunit.engine.core.tests.dll"); + var assemblyName = Path.Combine(GetSiblingDirectory("netcoreapp3.1"), "nunit.engine.core.tests.dll"); #endif Assert.That(assemblyName, Does.Exist); Console.WriteLine($"{assemblyName} does exist"); @@ -242,7 +242,7 @@ public static IEnumerable InvalidTargetFrameworkCombos() Assembly netFramework = typeof(ExtensionService).Assembly; var extNetStandard = new ExtensionAssembly(Path.Combine(GetSiblingDirectory("netstandard2.0"), "nunit.engine.dll"), false); - var extNetCore = new ExtensionAssembly(Path.Combine(GetSiblingDirectory("netcoreapp2.1"), "nunit.engine.tests.dll"), false); + var extNetCore = new ExtensionAssembly(Path.Combine(GetSiblingDirectory("netcoreapp3.1"), "nunit.engine.tests.dll"), false); yield return new TestCaseData(new FrameworkCombo(netFramework, extNetCore)).SetName("InvalidCombo(.NET Framework, .NET Core)"); #endif diff --git a/src/NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj b/src/NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj index 388576ee5..676667fde 100644 --- a/src/NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj +++ b/src/NUnitEngine/nunit.engine.core.tests/nunit.engine.core.tests.csproj @@ -2,7 +2,7 @@ NUnit.Engine.Core.Tests - net35;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net8.0 + net35;netcoreapp3.1;net5.0;net6.0;net8.0 Exe true ..\..\nunit.snk diff --git a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj index 80b65e858..97e45dd9d 100644 --- a/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj +++ b/src/NUnitEngine/nunit.engine.tests/nunit.engine.tests.csproj @@ -2,7 +2,7 @@ NUnit.Engine.Tests - net35;netcoreapp2.1 + net35;netcoreapp3.1 Exe true ..\..\nunit.snk @@ -29,7 +29,7 @@ - +