-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve tests using samples approach
add tests to build workflow
- Loading branch information
1 parent
c0caa15
commit 3bbddbd
Showing
9 changed files
with
112 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
path: DSIronPython | ||
repository: DynamoDS/DSIronPython | ||
ref: ${{ github.ref }} | ||
- name: Setup nuget | ||
uses: nuget/[email protected] | ||
- name: Setup msbuild | ||
|
@@ -28,9 +28,17 @@ jobs: | |
} else { | ||
Write-Error "python node dll was not found!" | ||
} | ||
- name: Get DynamoRuntime from s3 | ||
run: | | ||
curl -o DynamoRuntime.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime3.0.2.zip | ||
ls | ||
- name: Extract DynamoRuntime | ||
run: | | ||
7z x DynamoRuntime.zip -o${{ github.workspace }}\DSIronPython\IronPythonTests\bin\Release\DynamoRuntime | ||
- name: Run test with the dotnet CLI | ||
run: | | ||
dotnet test ${{ github.workspace }}\DSIronPython --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DSIronPython\TestResults | ||
dotnet test ${{ github.workspace }}\DSIronPython -p:Configuration=Release --filter "TestCategory!=Failure" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DSIronPython\TestResults | ||
- name: Upload build artifact | ||
uses: actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(SolutionDir)Config\shared.props" /> | ||
</ImportGroup> | ||
<PropertyGroup> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{E6DF2FBD-7D4D-4465-94DC-D576D737E985}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>IronPythonTests</RootNamespace> | ||
<AssemblyName>IronPythonTests</AssemblyName> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
<UseWPF>true</UseWPF> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<IsTestProject>true</IsTestProject> | ||
<IsPackable>false</IsPackable> | ||
|
||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="DynamoVisualProgramming.LibG_230_0_0" Version="3.0.0.3171" /> | ||
<PackageReference Include="DynamoVisualProgramming.Tests" Version="3.0.0-beta7023" /> | ||
<PackageReference Include="IronPython" Version="2.7.12" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
<PackageReference Include="NUnit" Version="3.14.0" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
<PackageReference Include="DynamoVisualProgramming.Tests" Version="3.1.0-beta3940"></PackageReference> | ||
<PackageReference Include="IronPython" Version="2.7.12" /> | ||
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.1.0-beta3940"> | ||
</PackageReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\DSIronPython\DSIronPython.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="DSCoreNodes"> | ||
<HintPath>..\extern\DSCoreNodes.dll</HintPath> | ||
</Reference> | ||
<Reference Include="FFITarget"> | ||
<HintPath>..\extern\FFITarget.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> | ||
</ItemGroup> | ||
</Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Globalization; | ||
using System.IO; | ||
using System.Reflection; | ||
using NUnit.Framework; | ||
|
||
|
||
[SetUpFixture] | ||
public class Setup | ||
{ | ||
private string moduleRootFolder; | ||
List<string> resolutionPaths; | ||
|
||
[OneTimeSetUp] | ||
public void RunBeforeAllTests() | ||
{ | ||
var thisDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); | ||
var configPath = Path.Combine(thisDir, "TestServices.dll.config"); | ||
|
||
// Adjust the config file map because the config file | ||
// might not always be in the same directory as the dll. | ||
var map = new ExeConfigurationFileMap { ExeConfigFilename = configPath }; | ||
var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); | ||
|
||
var element = config.AppSettings.Settings["DynamoBasePath"]; | ||
moduleRootFolder = element?.Value ?? string.Empty; | ||
|
||
if (string.IsNullOrEmpty(moduleRootFolder)) | ||
{ | ||
throw new Exception($"Missing DynamoBasePath in TestServices.dll.config. Please set the DynamoBasePath to a valid Dynamo bin folder. DynamoBasePath is set to {moduleRootFolder}"); | ||
} | ||
else if (!File.Exists(Path.Combine(moduleRootFolder, "DynamoCore.dll"))) | ||
{ | ||
throw new Exception($"Invalid DynamoBasePath in TestServices.dll.config. Please set the DynamoBasePath to a valid Dynamo bin folder. DynamoBasePath is set to {moduleRootFolder}"); | ||
} | ||
|
||
resolutionPaths = new List<string> | ||
{ | ||
// Search for nodes | ||
Path.Combine(moduleRootFolder, "nodes"), | ||
Path.Combine(moduleRootFolder, "en-us") | ||
}; | ||
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; ; | ||
} | ||
|
||
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) | ||
{ | ||
try | ||
{ | ||
var targetAssemblyName = new AssemblyName(args.Name).Name + ".dll"; | ||
|
||
// First check the core path | ||
string assemblyPath = Path.Combine(moduleRootFolder, targetAssemblyName); | ||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
|
||
// Then check all additional resolution paths | ||
foreach (var resolutionPath in resolutionPaths) | ||
{ | ||
assemblyPath = Path.Combine(resolutionPath, targetAssemblyName); | ||
if (File.Exists(assemblyPath)) | ||
{ | ||
return Assembly.LoadFrom(assemblyPath); | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
catch (Exception ex) | ||
{ | ||
throw new Exception(string.Format("There location of the assembly, " + | ||
"{0} could not be resolved for loading.", args.Name), ex); | ||
} | ||
} | ||
|
||
[OneTimeTearDown] | ||
public void RunAfterAllTests() | ||
{ | ||
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve; | ||
} | ||
} |
Binary file not shown.
Binary file not shown.