Skip to content

Commit

Permalink
Merge pull request #53 from TestCentric/issue-52
Browse files Browse the repository at this point in the history
Add Workflow for CI
  • Loading branch information
CharliePoole authored Oct 14, 2024
2 parents 0077ace + f35d15e commit 2bd5e75
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 28 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/testcentric-agent-core-ci.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions TestCentric.Agent.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
18 changes: 10 additions & 8 deletions build.cake
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/DirectTestAgent/DirectTestAgent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00017" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.0" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.0" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00022" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.2-dev00003" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00017" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.0" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00022" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.2-dev00003" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 1 addition & 9 deletions src/TestCentric.Agent.Core/Drivers/DriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDriverFactory>())
_factories.Add(factory);
Expand Down
13 changes: 10 additions & 3 deletions src/TestCentric.Agent.Core/Drivers/NUnit2DriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/TestCentric.Agent.Core/TestCentric.Agent.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00017" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.0" />
<PackageReference Include="TestCentric.Engine.Api" Version="2.0.0-dev00022" />
<PackageReference Include="TestCentric.Extensibility" Version="3.0.2-dev00003" />
<PackageReference Include="TestCentric.Metadata" Version="3.0.2" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.0" />
<PackageReference Include="TestCentric.InternalTrace" Version="1.2.1" />
</ItemGroup>

</Project>

0 comments on commit 2bd5e75

Please sign in to comment.