From 1de499906ba14760ea34f964313881742decac7a Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Tue, 15 Oct 2024 20:02:55 -0700 Subject: [PATCH] Add CI Workflow and update dependencies --- .github/workflows/testcentric-engine-ci.yml | 11 +++++ build.cake | 47 ++++++++++--------- .../Services/ExtensionService.cs | 13 ++--- .../testcentric.engine.csproj | 8 ++-- testcentric-engine.sln | 12 +++++ 5 files changed, 55 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/testcentric-engine-ci.yml diff --git a/.github/workflows/testcentric-engine-ci.yml b/.github/workflows/testcentric-engine-ci.yml new file mode 100644 index 0000000..0310fde --- /dev/null +++ b/.github/workflows/testcentric-engine-ci.yml @@ -0,0 +1,11 @@ +name: TestCentric.Engine.CI + +on: + workflow_dispatch: + pull_request: + push: + +jobs: + ContinuousIntegration: + uses: TestCentric/TestCentric.Workflows/.github/workflows/testcentric-ci.yml@main + secrets: inherit \ No newline at end of file diff --git a/build.cake b/build.cake index 4593374..8a0ce59 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,5 @@ // Load the recipe -#load nuget:?package=TestCentric.Cake.Recipe&version=1.3.2 +#load nuget:?package=TestCentric.Cake.Recipe&version=1.3.3 // Comment out above line and uncomment below for local tests of recipe changes //#load ../TestCentric.Cake.Recipe/recipe/*.cake @@ -39,12 +39,12 @@ packageTests.Add(new PackageTest(1, "Net35Test", "Run mock-assembly.dll targetin "engine-tests/net35/mock-assembly.dll", MockAssemblyExpectedResult("Net462AgentLauncher"))); -packageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll targeting .NET Core 3.1", - "engine-tests/netcoreapp3.1/mock-assembly.dll", - MockAssemblyExpectedResult("Net60AgentLauncher"))); - -if (!BuildSettings.IsRunningOnAppVeyor) +if (BuildSettings.IsLocalBuild) { + packageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll targeting .NET Core 3.1", + "engine-tests/netcoreapp3.1/mock-assembly.dll", + MockAssemblyExpectedResult("Net60AgentLauncher"))); + packageTests.Add(new PackageTest(1, "NetCore21Test", "Run mock-assembly.dll targeting .NET Core 2.1", "engine-tests/netcoreapp2.1/mock-assembly.dll", MockAssemblyExpectedResult("Net60AgentLauncher"))); @@ -62,10 +62,9 @@ packageTests.Add(new PackageTest(1, "Net70Test", "Run mock-assembly.dll targetin "engine-tests/net7.0/mock-assembly.dll", MockAssemblyExpectedResult("Net70AgentLauncher"))); -if (!BuildSettings.IsRunningOnAppVeyor) - packageTests.Add(new PackageTest(1, "Net80Test", "Run mock-assembly.dll targeting .NET 8.0", - "engine-tests/net8.0/mock-assembly.dll", - MockAssemblyExpectedResult("Net80AgentLauncher"))); +packageTests.Add(new PackageTest(1, "Net80Test", "Run mock-assembly.dll targeting .NET 8.0", + "engine-tests/net8.0/mock-assembly.dll", + MockAssemblyExpectedResult("Net80AgentLauncher"))); static ExpectedResult MockAssemblyExpectedResult(params string[] agentNames) { @@ -89,20 +88,22 @@ static ExpectedResult MockAssemblyExpectedResult(params string[] agentNames) // AspNetCore Tests -packageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", - "engine-tests/netcoreapp3.1/aspnetcore-test.dll", - new ExpectedResult("Passed") - { - Assemblies = new [] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } - })); +if (BuildSettings.IsLocalBuild) +{ + packageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", + "engine-tests/netcoreapp3.1/aspnetcore-test.dll", + new ExpectedResult("Passed") + { + Assemblies = new[] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } + })); -if (!BuildSettings.IsRunningOnAppVeyor) packageTests.Add(new PackageTest(1, "AspNetCore50Test", "Run test using AspNetCore under .NET 5.0", "engine-tests/net5.0/aspnetcore-test.dll", new ExpectedResult("Passed") { - Assemblies = new [] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } + Assemblies = new[] { new ExpectedAssemblyResult("aspnetcore-test.dll", "Net60AgentLauncher") } })); +} packageTests.Add(new PackageTest(1, "AspNetCore60Test", "Run test using AspNetCore under .NET 6.0", "engine-tests/net6.0/aspnetcore-test.dll", @@ -120,7 +121,7 @@ packageTests.Add(new PackageTest(1, "AspNetCore70Test", "Run test using AspNetCo // Windows Forms Tests -if (!BuildSettings.IsRunningOnAppVeyor) +if (BuildSettings.IsLocalBuild) packageTests.Add(new PackageTest(1, "Net50WindowsFormsTest", "Run test using windows forms under .NET 5.0", "engine-tests/net5.0-windows/windows-forms-test.dll", new ExpectedResult("Passed") @@ -210,10 +211,10 @@ BuildSettings.Packages.Add(new NuGetPackage( }, tests: packageTests, preloadedExtensions: new [] { - KnownExtensions.Net462PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net60PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net70PluggableAgent.NuGetPackage.LatestDevBuild, - KnownExtensions.Net80PluggableAgent.NuGetPackage.LatestDevBuild } + KnownExtensions.Net462PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net60PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net70PluggableAgent.SetVersion("2.5.1").NuGetPackage, + KnownExtensions.Net80PluggableAgent.SetVersion("2.5.1").NuGetPackage } )); ////////////////////////////////////////////////////////////////////// diff --git a/src/TestEngine/testcentric.engine/Services/ExtensionService.cs b/src/TestEngine/testcentric.engine/Services/ExtensionService.cs index 659dee3..4d5ca51 100644 --- a/src/TestEngine/testcentric.engine/Services/ExtensionService.cs +++ b/src/TestEngine/testcentric.engine/Services/ExtensionService.cs @@ -4,6 +4,7 @@ // *********************************************************************** using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Reflection; using TestCentric.Engine.Internal; @@ -95,15 +96,9 @@ public override void StartService() { try { - - _extensionManager = new ExtensionManager(ENGINE_ASSEMBLY, ENGINE_API_ASSEMBLY) - { - DefaultTypeExtensionPrefix = "/TestCentric/Engine/TypeExtensions/", - InitialAddinsDirectory = ENGINE_DIRECTORY - }; - - _extensionManager.Initialize(); - + _extensionManager = new ExtensionManager("/TestCentric/Engine/TypeExtensions/"); + _extensionManager.FindExtensionPoints(ENGINE_ASSEMBLY, ENGINE_API_ASSEMBLY); + _extensionManager.FindExtensions(ENGINE_DIRECTORY); Status = ServiceStatus.Started; } catch diff --git a/src/TestEngine/testcentric.engine/testcentric.engine.csproj b/src/TestEngine/testcentric.engine/testcentric.engine.csproj index 7750575..145a4b5 100644 --- a/src/TestEngine/testcentric.engine/testcentric.engine.csproj +++ b/src/TestEngine/testcentric.engine/testcentric.engine.csproj @@ -44,11 +44,11 @@ - + - - - + + + \ No newline at end of file diff --git a/testcentric-engine.sln b/testcentric-engine.sln index 50527de..97a321e 100644 --- a/testcentric-engine.sln +++ b/testcentric-engine.sln @@ -50,6 +50,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "windows-forms-test", "src\T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "testcentric.engine.tests", "src\TestEngine\testcentric.engine.tests\testcentric.engine.tests.csproj", "{5C9826A6-4A5C-4CE4-9BCE-4C4DB091EECB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{5EF03E03-77C4-4CF0-8FBA-E07025257A1A}" + ProjectSection(SolutionItems) = preProject + .github\dependabot.yml = .github\dependabot.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{4A075BD7-F73E-42FF-87E6-41A6226B9628}" + ProjectSection(SolutionItems) = preProject + .github\workflows\testcentric-engine-ci.yml = .github\workflows\testcentric-engine-ci.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -106,6 +116,8 @@ Global {6100F27F-D346-4F18-841E-EEA2BD2CC08E} = {EA14AF63-0F5D-4938-9C87-6EC67A961DB3} {81412379-ABD5-4079-A32A-1C887FA74674} = {EA14AF63-0F5D-4938-9C87-6EC67A961DB3} {5C9826A6-4A5C-4CE4-9BCE-4C4DB091EECB} = {EA14AF63-0F5D-4938-9C87-6EC67A961DB3} + {5EF03E03-77C4-4CF0-8FBA-E07025257A1A} = {A65042E1-D8BC-48DD-8DE1-F0991F07EA77} + {4A075BD7-F73E-42FF-87E6-41A6226B9628} = {5EF03E03-77C4-4CF0-8FBA-E07025257A1A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CDFF439B-8888-4133-8734-86F4F899BC40}