diff --git a/.github/workflows/testcentric-agent-core-ci.yml b/.github/workflows/testcentric-agent-core-ci.yml new file mode 100644 index 0000000..7a6bd40 --- /dev/null +++ b/.github/workflows/testcentric-agent-core-ci.yml @@ -0,0 +1,11 @@ +name: TestCentric.Agent.Core.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/TestCentric.Agent.Core.sln b/TestCentric.Agent.Core.sln index 38ecb89..d95e0b2 100644 --- a/TestCentric.Agent.Core.sln +++ b/TestCentric.Agent.Core.sln @@ -38,6 +38,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aspnetcore-test", "src\Test EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "windows-forms-test", "src\TestData\windows-forms-test\windows-forms-test.csproj", "{FE2601F1-2E3F-45DE-B812-F7764F02CAB2}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{13F7EF0F-31AD-4EE0-9391-7BE7BCAA9756}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{64CC1A42-B482-4F8E-BBEF-6F3435BCCB66}" + ProjectSection(SolutionItems) = preProject + .github\workflows\testcentric-agent-core-ci.yml = .github\workflows\testcentric-agent-core-ci.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -129,6 +136,8 @@ Global {E61CFB73-49FC-4A63-903D-9209B2CC538A} = {374E8CCC-DB1E-4228-A205-2657A80B1889} {081E0546-9041-4A36-B5F4-D674FFA4B947} = {374E8CCC-DB1E-4228-A205-2657A80B1889} {FE2601F1-2E3F-45DE-B812-F7764F02CAB2} = {374E8CCC-DB1E-4228-A205-2657A80B1889} + {13F7EF0F-31AD-4EE0-9391-7BE7BCAA9756} = {49BC1DFB-828F-49F4-B2B4-752AB470481D} + {64CC1A42-B482-4F8E-BBEF-6F3435BCCB66} = {13F7EF0F-31AD-4EE0-9391-7BE7BCAA9756} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {CAB7BD1E-1034-47CD-AA8E-FD4AC034193B} diff --git a/build.cake b/build.cake index 96f3601..a07d074 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 @@ -36,9 +36,10 @@ packageTests.Add(new PackageTest(1, "Net462Test", "Run mock-assembly.dll targeti "mock-assembly/net462/mock-assembly.dll", mockAssemblyExpectedResult)); -packageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll targeting .NET Core 3.1", - "mock-assembly/netcoreapp3.1/mock-assembly.dll", - mockAssemblyExpectedResult)); +if (BuildSettings.IsLocalBuild) + packageTests.Add(new PackageTest(1, "NetCore31Test", "Run mock-assembly.dll targeting .NET Core 3.1", + "mock-assembly/netcoreapp3.1/mock-assembly.dll", + mockAssemblyExpectedResult)); packageTests.Add(new PackageTest(1, "Net60Test", "Run mock-assembly.dll targeting .NET 6.0", "mock-assembly/net6.0/mock-assembly.dll", @@ -50,10 +51,11 @@ packageTests.Add(new PackageTest(1, "Net80Test", "Run mock-assembly.dll targetin // Asp .NET Core Tests -packageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", - "aspnetcore-test/netcoreapp3.1/aspnetcore-test.dll", - new ExpectedResult("Passed"){ Assemblies = new ExpectedAssemblyResult[] { - new ExpectedAssemblyResult("aspnetcore-test.dll")} })); +if (BuildSettings.IsLocalBuild) + packageTests.Add(new PackageTest(1, "AspNetCore31Test", "Run test using AspNetCore under .NET Core 3.1", + "aspnetcore-test/netcoreapp3.1/aspnetcore-test.dll", + new ExpectedResult("Passed"){ Assemblies = new ExpectedAssemblyResult[] { + new ExpectedAssemblyResult("aspnetcore-test.dll")} })); packageTests.Add(new PackageTest(1, "AspNetCore50Test", "Run test using AspNetCore under .NET 5.0", "aspnetcore-test/net5.0/aspnetcore-test.dll", diff --git a/src/DirectTestAgent/DirectTestAgent.csproj b/src/DirectTestAgent/DirectTestAgent.csproj index a7134eb..d1dcb01 100644 --- a/src/DirectTestAgent/DirectTestAgent.csproj +++ b/src/DirectTestAgent/DirectTestAgent.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/TestCentric.Agent.Core.Tests/TestCentric.Agent.Core.Tests.csproj b/src/TestCentric.Agent.Core.Tests/TestCentric.Agent.Core.Tests.csproj index 5ffb879..bb02b2d 100644 --- a/src/TestCentric.Agent.Core.Tests/TestCentric.Agent.Core.Tests.csproj +++ b/src/TestCentric.Agent.Core.Tests/TestCentric.Agent.Core.Tests.csproj @@ -38,8 +38,8 @@ - - + + diff --git a/src/TestCentric.Agent.Core/Drivers/DriverService.cs b/src/TestCentric.Agent.Core/Drivers/DriverService.cs index d090523..f30fc21 100644 --- a/src/TestCentric.Agent.Core/Drivers/DriverService.cs +++ b/src/TestCentric.Agent.Core/Drivers/DriverService.cs @@ -28,15 +28,7 @@ public DriverService() { log.Debug("Creating ExtensionManager"); var thisAssembly = Assembly.GetExecutingAssembly(); - var extensionManager = new ExtensionManager(thisAssembly) { - DefaultTypeExtensionPrefix = "/TestCentric/Engine/TypeExtensions/", - InitialAddinsDirectory = Path.GetDirectoryName(thisAssembly.Location) - //InternalTraceLevel = InternalTrace.TraceLevel, - //WorkDirectory = Environment.CurrentDirectory - }; - - log.Debug($"Initializing ExtensionManager"); - extensionManager.Initialize(); + var extensionManager = new ExtensionManager("/TestCentric/Engine/TypeExtensions/"); foreach (IDriverFactory factory in extensionManager.GetExtensions()) _factories.Add(factory); diff --git a/src/TestCentric.Agent.Core/Drivers/NUnit2DriverFactory.cs b/src/TestCentric.Agent.Core/Drivers/NUnit2DriverFactory.cs index 3bb6a3d..8080220 100644 --- a/src/TestCentric.Agent.Core/Drivers/NUnit2DriverFactory.cs +++ b/src/TestCentric.Agent.Core/Drivers/NUnit2DriverFactory.cs @@ -16,13 +16,13 @@ public class NUnit2DriverFactory : IDriverFactory { private const string NUNIT_FRAMEWORK = "nunit.framework"; private const string NUNITLITE_FRAMEWORK = "nunitlite"; - private ExtensionNode _driverNode; + private IExtensionNode _driverNode; // TODO: This should be a central service but for now it's local private ProvidedPathsAssemblyResolver _resolver; bool _resolverInstalled; - public NUnit2DriverFactory(ExtensionNode driverNode) + public NUnit2DriverFactory(IExtensionNode driverNode) { _driverNode = driverNode; _resolver = new ProvidedPathsAssemblyResolver(); @@ -58,7 +58,14 @@ public IFrameworkDriver GetDriver(AppDomain domain, AssemblyName reference) _resolver.AddPathFromFile(_driverNode.AssemblyPath); } - return _driverNode.CreateExtensionObject(domain) as IFrameworkDriver; + return AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap( + _driverNode.AssemblyPath, _driverNode.TypeName, +#if NET20 + false, 0, null, new[] { domain }, null, null, null) as IFrameworkDriver; +#else + false, 0, null, new[] { domain }, null, null) as IFrameworkDriver; +#endif + //return _driverNode.CreateExtensionObject(domain) as IFrameworkDriver; } } } diff --git a/src/TestCentric.Agent.Core/TestCentric.Agent.Core.csproj b/src/TestCentric.Agent.Core/TestCentric.Agent.Core.csproj index c43f6fd..0606dec 100644 --- a/src/TestCentric.Agent.Core/TestCentric.Agent.Core.csproj +++ b/src/TestCentric.Agent.Core/TestCentric.Agent.Core.csproj @@ -44,10 +44,10 @@ - - + + - +