Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/NUnitConsoleAndEngine.CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: 🔧 Install dotnet tools
run: dotnet tool restore
Expand Down
12 changes: 8 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net9.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_FILES_NETCORE)
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net11.0").WithFiles(AGENT_FILES_NETCORE)
},
symbols: new PackageCheck[] {
HasDirectory("tools").WithFiles(ENGINE_PDB_FILES).AndFile("nunit3-console.pdb"),
HasDirectory("tools/agents/net462").WithFiles(AGENT_PDB_FILES),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("tools/agents/net9.0").WithFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_PDB_FILES_NETCORE)
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("tools/agents/net11.0").WithFiles(AGENT_PDB_FILES_NETCORE)
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.NuGetTestDirectory
+ $"NUnit.ConsoleRunner.{BuildSettings.PackageVersion}/tools/nunit3-console.exe"),
Expand Down Expand Up @@ -113,7 +115,8 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasDirectory("tools/agents/net462").WithFiles(AGENT_FILES),
HasDirectory("tools/agents/net8.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net9.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_FILES_NETCORE)
HasDirectory("tools/agents/net10.0").WithFiles(AGENT_FILES_NETCORE),
HasDirectory("tools/agents/net11.0").WithFiles(AGENT_FILES_NETCORE)
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.ChocolateyTestDirectory
+ $"nunit-console-runner.{BuildSettings.PackageVersion}/tools/nunit3-console.exe"),
Expand All @@ -134,7 +137,8 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
HasDirectory("bin/agents/net462").WithFiles(AGENT_FILES).AndFiles(AGENT_PDB_FILES),
HasDirectory("bin/agents/net8.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("bin/agents/net9.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("bin/agents/net10.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE)
HasDirectory("bin/agents/net10.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE),
HasDirectory("bin/agents/net11.0").WithFiles(AGENT_FILES_NETCORE).AndFiles(AGENT_PDB_FILES_NETCORE)
},
testRunner: new ConsoleRunnerSelfTester(BuildSettings.ZipTestDirectory
+ $"NUnit.Console.{BuildSettings.PackageVersion}/bin/net462/nunit3-console.exe"),
Expand Down
12 changes: 12 additions & 0 deletions choco/nunit-console-runner.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,17 @@
<file src = "$BIN_DIR$agents/net10.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net10.0" />
<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools/agents/net10.0" />

<file src = "$BIN_DIR$agents/net11.0/nunit-agent.dll" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit-agent.dll.config" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit-agent.deps.json" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit-agent.runtimeconfig.json" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit.engine.api.dll" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit.engine.api.xml" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/nunit.engine.core.dll" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/testcentric.engine.metadata.dll" target="tools/agents/net11.0" />
<file src = "$BIN_DIR$agents/net11.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net11.0" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Include the Chocolatey marker beside the new .NET 11 agent

The new net11.0 directory does not receive VERIFICATION.txt: the marker following this block still targets net10.0. ExtensionManager.FindExtensionAssemblies(Assembly) checks beside the host assembly for this file and otherwise searches the NuGet-style NUnit.Extension.* directories rather than Chocolatey's nunit-extension-* directories. As a result, the new agent misses extensions installed through Chocolatey even though ordinary NUnit execution and the current package checks pass.

I reproduced this with the exact PR engine and its existing FakeExtensions assembly in a Chocolatey-shaped layout: without the marker, zero extensions are found; adding only VERIFICATION.txt beside the net11.0 core finds all seven fixture extensions. Please retain the net10.0 marker and add a separate entry targeting tools/agents/net11.0. A Chocolatey package-content assertion for that marker would catch this omission.

<!-- File used by ExtensionManager to indicate this is a chocolatey installation -->
<file src = "VERIFICATION.txt" target = "tools/agents/net11.0" />
</files>
</package>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.0",
"version": "11.0.0",
"rollForward": "feature"
}
}
13 changes: 13 additions & 0 deletions nuget/runners/nunit.console-runner.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
<file src="agents/net10.0/testcentric.engine.metadata.dll" target="tools/agents/net10.0" />
<file src="agents/net10.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net10.0" />

<file src="agents/net11.0/nunit-agent.dll" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit-agent.pdb" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit-agent.dll.config" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit-agent.deps.json" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit-agent.runtimeconfig.json" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit.engine.api.dll" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit.engine.api.pdb" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit.engine.api.xml" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit.engine.core.dll" target="tools/agents/net11.0" />
<file src="agents/net11.0/nunit.engine.core.pdb" target="tools/agents/net11.0" />
<file src="agents/net11.0/testcentric.engine.metadata.dll" target="tools/agents/net11.0" />
<file src="agents/net11.0/Microsoft.Extensions.DependencyModel.dll" target="tools/agents/net11.0" />

<file src="net462/nunit3-console.exe" target="tools" />
<file src="net462/nunit3-console.pdb" target="tools" />
<file src="net462/nunit3-console.exe.config" target="tools" />
Expand Down
17 changes: 12 additions & 5 deletions package-tests.cake
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public static class PackageTests
ExpectedResult=new MockAssemblyExpectedResult("net-4.6.2")
});

AllLists.Add(new PackageTest(1, "Net11Test")
{
Description = "Run mock-assembly.dll targeting .NET 11.0",
Arguments = "testdata/net11.0/mock-assembly.dll",
ExpectedResult = new MockAssemblyExpectedResult("netcore-11.0")
});

AllLists.Add(new PackageTest(1, "Net10Test")
{
Description = "Run mock-assembly.dll targeting .NET 10.0",
Expand Down Expand Up @@ -152,11 +159,11 @@ public static class PackageTests
ExpectedResult = new MockAssemblyExpectedResult("net-4.6.2", "net-4.6.2")
});

StandardAndZipLists.Add(new PackageTest(1, "Net60PlusNet80PlusNet10Test")
StandardAndZipLists.Add(new PackageTest(1, "Net60PlusNet80PlusNet10PlusNet11Test")
{
Description = "Run mock-assembly targeting .NET6.0 and 8.0 together",
Arguments = "testdata/net6.0/mock-assembly.dll testdata/net8.0/mock-assembly.dll testdata/net10.0/mock-assembly.dll",
ExpectedResult = new MockAssemblyExpectedResult("netcore-6.0", "netcore-8.0", "netcore-10.0")
Description = "Run mock-assembly targeting .NET6.0, 8.0, 10.0, and 11.0 together",
Arguments = "testdata/net6.0/mock-assembly.dll testdata/net8.0/mock-assembly.dll testdata/net10.0/mock-assembly.dll testdata/net11.0/mock-assembly.dll",
ExpectedResult = new MockAssemblyExpectedResult("netcore-6.0", "netcore-8.0", "netcore-10.0", "netcore-11.0")
});

StandardAndZipLists.Add(new PackageTest(1, "Net462PlusNet60Test")
Expand Down Expand Up @@ -334,7 +341,7 @@ public static class PackageTests
{
Description = "Run mock-assembly using the .csproj file",
Arguments = "../../src/TestData/mock-assembly/mock-assembly.csproj --config=Release",
ExpectedResult = new MockAssemblyExpectedResult("net462", "netcore-3.1", "netcore-6.0", "netcore-7.0", "netcore-8.0", "netcore-9.0", "netcore-10.0"),
ExpectedResult = new MockAssemblyExpectedResult("net462", "netcore-3.1", "netcore-6.0", "netcore-7.0", "netcore-8.0", "netcore-9.0", "netcore-10.0", "netcore-11.0"),
ExtensionsNeeded = new[] { Extensions.VSProjectLoader }
});

Expand Down
2 changes: 1 addition & 1 deletion src/NUnitEngine/nunit-agent/nunit-agent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>nunit.agent</RootNamespace>
<TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net462;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<ApplicationManifest>app.manifest</ApplicationManifest>
<ApplicationIcon>..\..\..\nunit.ico</ApplicationIcon>
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Engine</RootNamespace>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
Expand Down
6 changes: 5 additions & 1 deletion src/NUnitEngine/nunit.engine.core/nunit.engine.core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Engine</RootNamespace>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<NoWarn>$(NoWarn);SYSLIB0011;SYSLIB0012</NoWarn><!-- TODO: Get rid of obsolete stuff -->
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
Expand Down Expand Up @@ -38,6 +38,10 @@
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="10.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net11.0'">
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="11.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="TestCentric.Metadata" Version="2.0.0" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/NUnitEngine/nunit.engine/Services/AgentProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ public static string GetTestAgentExePath(RuntimeFramework targetRuntime, bool re
agentExtension = ".exe";
break;
case RuntimeType.NetCore:
runtimeDir = major >= 10 ? "net10.0" : major >= 9 ? "net9.0" : "net8.0";
runtimeDir = major >= 11 ? "net11.0"
: major >= 10 ? "net10.0"
: major >= 9 ? "net9.0"
: "net8.0";
agentName = "nunit-agent";
agentExtension = ".dll";
break;
Expand Down
2 changes: 1 addition & 1 deletion src/TestData/mock-assembly-x86/mock-assembly-x86.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Tests</RootNamespace>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net7.0;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<OutputPath>..\..\..\bin\$(Configuration)\testdata\</OutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
Expand Down
2 changes: 1 addition & 1 deletion src/TestData/mock-assembly/mock-assembly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>NUnit.Tests</RootNamespace>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net7.0;net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net7.0;net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<OutputPath>..\..\..\bin\$(Configuration)\testdata\</OutputPath>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\nunit.snk</AssemblyOriginatorKeyFile>
Expand Down
Loading