Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update recipe #1641

Merged
merged 1 commit into from
Mar 12, 2025
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
12 changes: 6 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Load the recipe
#load nuget:?package=NUnit.Cake.Recipe&version=1.4.0-alpha.6
#load nuget:?package=NUnit.Cake.Recipe&version=1.4.0-alpha.7
// Comment out above line and uncomment below for local tests of recipe changes
//#load ../NUnit.Cake.Recipe/recipe/*.cake

Expand Down Expand Up @@ -127,11 +127,11 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] {
+ $"NUnit.Console.{BuildSettings.PackageVersion}/bin/net462/nunit3-console.exe"),
tests: PackageTests.ZipRunnerTests,
bundledExtensions: new [] {
KnownExtensions.VSProjectLoader.NuGetPackage,
KnownExtensions.NUnitProjectLoader.NuGetPackage,
KnownExtensions.NUnitV2Driver.NuGetPackage,
KnownExtensions.NUnitV2ResultWriter.NuGetPackage,
KnownExtensions.TeamCityEventListener.NuGetPackage
Extensions.VSProjectLoader.NuGetPackage,
Extensions.NUnitProjectLoader.NuGetPackage,
Extensions.NUnitV2Driver.NuGetPackage,
Extensions.NUnitV2ResultWriter.NuGetPackage,
Extensions.TeamCityEventListener.NuGetPackage
}),

// NOTE: Packages below this point have no direct tests
Expand Down
37 changes: 26 additions & 11 deletions package-tests.cake
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
public static class Extensions
{
// Extensions used in tests, with version specified.
public static ExtensionSpecifier NUnitV2Driver = new ExtensionSpecifier(
"NUnit.Extension.NUnitV2Driver", "nunit-extension-nunit-v2-driver", "3.9.0");
public static ExtensionSpecifier NUnitProjectLoader = new ExtensionSpecifier(
"NUnit.Extension.NUnitProjectLoader", "nunit-extension-nunit-project-loader", "3.8.0");
public static ExtensionSpecifier VSProjectLoader = new ExtensionSpecifier(
"NUnit.Extension.VSProjectLoader", "nunit-extension-vs-project-loader", "3.9.0");
public static ExtensionSpecifier NUnitV2ResultWriter = new ExtensionSpecifier(
"NUnit.Extension.NUnitV2ResultWriter", "nunit-extension-nunit-v2-result-writer", "3.8.0");
public static ExtensionSpecifier TeamCityEventListener = new ExtensionSpecifier(
"NUnit.Extension.TeamCityEventListener", "nunit-extension-teamcity-event-listener", "1.0.9");
}

public static class PackageTests
{
// Tests run for the Standard runner packages (both nuget and chocolatey)
Expand Down Expand Up @@ -261,15 +276,15 @@ public static class PackageTests
Description = "Run NUnit project with mock-assembly.dll targeting .NET 4.6.2 and 6.0",
Arguments = "../../MixedTests.nunit --config=Release",
ExpectedResult = new MockAssemblyExpectedResult("net-4.6.2", "net-6.0"),
ExtensionsNeeded = new [] { KnownExtensions.NUnitProjectLoader }
ExtensionsNeeded = new [] { Extensions.NUnitProjectLoader }
});

NetCoreRunnerTests.Add(new PackageTest(1, "NUnitProjectTest")
{
Description= "Run NUnit project with mock-assembly.dll targeting .NET 6.0 and 8.0",
Arguments="../../NetCoreTests.nunit --config=Release",
ExpectedResult = new MockAssemblyExpectedResult("netcore-6.0", "netcore-8.0"),
ExtensionsNeeded = new [] { KnownExtensions.NUnitProjectLoader }
ExtensionsNeeded = new [] { Extensions.NUnitProjectLoader }
});

// V2 Result Writer Test
Expand All @@ -278,7 +293,7 @@ public static class PackageTests
Description = "Run mock-assembly targeting .NET 6.0 and produce V2 output",
Arguments = "testdata/net6.0/mock-assembly.dll --result=TestResult.xml --result=NUnit2TestResult.xml;format=nunit2",
ExpectedResult = new MockAssemblyExpectedResult("netcore-6.0"),
ExtensionsNeeded = new[] { KnownExtensions.NUnitV2ResultWriter }
ExtensionsNeeded = new[] { Extensions.NUnitV2ResultWriter }
});

// VS Project Loader Tests
Expand All @@ -287,7 +302,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"),
ExtensionsNeeded = new[] { KnownExtensions.VSProjectLoader }
ExtensionsNeeded = new[] { Extensions.VSProjectLoader }
});

StandardAndZipLists.Add(new PackageTest(1, "VSProjectLoaderTest_Solution")
Expand Down Expand Up @@ -315,7 +330,7 @@ public static class PackageTests
new ExpectedAssemblyResult("WpfApp.exe")
}
},
ExtensionsNeeded = new[] { KnownExtensions.VSProjectLoader }
ExtensionsNeeded = new[] { Extensions.VSProjectLoader }
});

// TeamCity Event Listener Tests
Expand All @@ -324,7 +339,7 @@ public static class PackageTests
Description = "Run mock-assembly targeting .NET 4.6.2 with --teamcity option",
Arguments = "testdata/net462/mock-assembly.dll --teamcity --trace:Debug",
ExpectedResult = new MockAssemblyExpectedResult("net-4.6.2"),
ExtensionsNeeded = new[] { KnownExtensions.TeamCityEventListener },
ExtensionsNeeded = new[] { Extensions.TeamCityEventListener },
OutputCheck = new OutputContains("##teamcity")
});

Expand All @@ -334,7 +349,7 @@ public static class PackageTests
Description = "Run mock-assembly targeting .NET 4.6.2 with --enable teamcity option",
Arguments = "testdata/net462/mock-assembly.dll --enable:NUnit.Engine.Listeners.TeamCityEventListener --trace:Debug",
ExpectedResult = new MockAssemblyExpectedResult("net-4.6.2"),
ExtensionsNeeded = new[] { KnownExtensions.TeamCityEventListener },
ExtensionsNeeded = new[] { Extensions.TeamCityEventListener },
OutputCheck = new OutputContains("##teamcity")
});

Expand All @@ -343,7 +358,7 @@ public static class PackageTests
Description = "Run mock-assembly targeting .NET 6.0 with --teamcity option",
Arguments = "testdata/net6.0/mock-assembly.dll --teamcity --trace:Debug",
ExpectedResult = new MockAssemblyExpectedResult("net-6.0"),
ExtensionsNeeded = new[] { KnownExtensions.TeamCityEventListener },
ExtensionsNeeded = new[] { Extensions.TeamCityEventListener },
OutputCheck = new OutputContains("##teamcity")
});

Expand All @@ -353,7 +368,7 @@ public static class PackageTests
Description = "Run mock-assembly targeting .NET 6.0 with --enable teamcity option",
Arguments = "testdata/net6.0/mock-assembly.dll --enable:NUnit.Engine.Listeners.TeamCityEventListener --trace:Debug",
ExpectedResult = new MockAssemblyExpectedResult("net-6.0"),
ExtensionsNeeded = new[] { KnownExtensions.TeamCityEventListener },
ExtensionsNeeded = new[] { Extensions.TeamCityEventListener },
OutputCheck = new OutputContains("##teamcity")
});

Expand All @@ -372,7 +387,7 @@ public static class PackageTests
Skipped = 4,
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly-v2.dll", "net-4.6.2") }
},
ExtensionsNeeded = new[] { KnownExtensions.NUnitV2Driver }
ExtensionsNeeded = new[] { Extensions.NUnitV2Driver }
});

StandardAndZipLists.Add(new PackageTest(1, "V2FrameworkDriverTest")
Expand All @@ -389,7 +404,7 @@ public static class PackageTests
Skipped = 4,
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly-v2.dll", "net-4.6.2") }
},
ExtensionsNeeded = new[] { KnownExtensions.NUnitV2Driver }
ExtensionsNeeded = new[] { Extensions.NUnitV2Driver }
});

//////////////////////////////////////////////////////////////////////
Expand Down
Loading