Skip to content

Commit 75e73b8

Browse files
authored
add tests (#53)
* add tests * update * Update SampleIntegration.csproj * update * Update build.yml * do not run asm tests * update
1 parent df9e1b0 commit 75e73b8

File tree

18 files changed

+1026
-55
lines changed

18 files changed

+1026
-55
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,26 @@ jobs:
6060
Write-Error "$path was not found!"
6161
}
6262
}
63+
- name: Get DynamoRuntime from s3
64+
run: |
65+
curl -o DynamoRuntime.zip https://dyn-builds-data.s3-us-west-2.amazonaws.com/DynamoCoreRuntime_3.1.0.4081_20240212T2057.zip
66+
ls
67+
- name: Extract DynamoRuntime
68+
run: |
69+
7z x DynamoRuntime.zip -o${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests\bin\Release\DynamoRuntime
70+
71+
- name: Run test with the dotnet CLI
72+
run: |
73+
dotnet test ${{ github.workspace }}\DynamoSamples\src\SampleLibraryTests -p:Configuration=Release --filter "TestCategory!=Failure&TestCategory!=NEEDS_GEOM_LIB" --logger "trx;LogFileName=results.trx" --results-directory ${{ github.workspace }}\DynamoSamples\TestResults
74+
- name: Upload build artifact
75+
uses: actions/[email protected]
76+
with:
77+
name: DynamoSamples
78+
path: ${{ github.workspace }}\DynamoSamples\dynamo_package
79+
retention-days: 7
80+
- name: Upload test artifact
81+
uses: actions/[email protected]
82+
with:
83+
name: TestResults
84+
path: ${{ github.workspace }}\DynamoSamples\TestResults
85+
retention-days: 1

src/Config/CS.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
44
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
55
<PlatformTarget >x64</PlatformTarget>
6-
<TargetFramework>net8.0</TargetFramework>
76
<FileAlignment>512</FileAlignment>
87
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
98
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

src/Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!--
4+
SolutionDir is mostly useful for running the dotnet test command
5+
Ex. open a command line in the DynamoSamples directory and run:
6+
dotnet test %cd%\src\SampleLibraryTests -p:Configuration=Release - -filter "TestCategory!=Failure" - -logger "trx;LogFileName=results.trx" - -results-directory TestResults
7+
Note: The - -filter, - -logger and - -results-directory should have double dashes without a space in between. -->
8+
<SolutionDir>$(MSBuildThisFileDirectory)\</SolutionDir>
9+
</PropertyGroup>
10+
</Project>

src/SampleExtension/SampleExtension.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
77
<RootNamespace>SampleExtension</RootNamespace>
88
<AssemblyName>SampleExtension</AssemblyName>
9+
<TargetFramework>net8.0</TargetFramework>
910
<!--EnableDynamicLoading prepares the project so that it can be used as a plugin -->
1011
<!--https://learn.microsoft.com/en-us/dotnet/core/tutorials/creating-app-with-plugin-support#simple-plugin-with-no-dependencies-->
1112
<EnableDynamicLoading>true</EnableDynamicLoading>
@@ -16,6 +17,6 @@
1617
</Content>
1718
</ItemGroup>
1819
<ItemGroup>
19-
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.1.0-beta3755" ExcludeAssets="runtime" />
20+
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.1.0-beta4081" ExcludeAssets="runtime" />
2021
</ItemGroup>
2122
</Project>

src/SampleIntegration/SampleIntegration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<PropertyGroup>
66
<RootNamespace>SampleIntegration</RootNamespace>
77
<AssemblyName>SampleIntegration</AssemblyName>
8+
<TargetFramework>net8.0</TargetFramework>
89
</PropertyGroup>
910
<ItemGroup>
1011
<PackageReference Include="DynamoVisualProgramming.Core" Version="3.0.0-beta7064" />
Lines changed: 235 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,235 @@
1-
<Workspace Version="0.7.5.3240" X="146.89726815586" Y="9.96610837046791" zoom="1.05281788169755" Description="" Category="" Name="Home">
2-
<Elements>
3-
<Dynamo.Nodes.Watch type="Dynamo.Nodes.Watch" guid="2c4cdf29-f078-497c-86b8-fed323f4b77d" nickname="Watch" x="613.408069206988" y="243.832684826672" isVisible="true" isUpstreamVisible="true" lacing="Disabled" />
4-
<Dynamo.Nodes.DSFunction type="Dynamo.Nodes.DSFunction" guid="4964a3ed-b14b-46dd-8e61-4d64fad42128" nickname="+" x="404.715400784895" y="238.891755796865" isVisible="true" isUpstreamVisible="true" lacing="Shortest" assembly="" function="+@," />
5-
<Dynamo.Nodes.DoubleInput type="Dynamo.Nodes.DoubleInput" guid="77af56fb-6e37-4324-85e0-08870d79cb40" nickname="Number" x="213.542102183797" y="205.878060420374" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
6-
<System.Double value="21" />
7-
</Dynamo.Nodes.DoubleInput>
8-
<Dynamo.Nodes.DoubleInput type="Dynamo.Nodes.DoubleInput" guid="a603bf14-8040-4297-bea8-5441d71645ed" nickname="Number" x="209.475123227426" y="283.764275525103" isVisible="true" isUpstreamVisible="true" lacing="Disabled">
9-
<System.Double value="21" />
10-
</Dynamo.Nodes.DoubleInput>
11-
</Elements>
12-
<Connectors>
13-
<Dynamo.Models.ConnectorModel start="4964a3ed-b14b-46dd-8e61-4d64fad42128" start_index="0" end="2c4cdf29-f078-497c-86b8-fed323f4b77d" end_index="0" portType="0" />
14-
<Dynamo.Models.ConnectorModel start="77af56fb-6e37-4324-85e0-08870d79cb40" start_index="0" end="4964a3ed-b14b-46dd-8e61-4d64fad42128" end_index="0" portType="0" />
15-
<Dynamo.Models.ConnectorModel start="a603bf14-8040-4297-bea8-5441d71645ed" start_index="0" end="4964a3ed-b14b-46dd-8e61-4d64fad42128" end_index="1" portType="0" />
16-
</Connectors>
17-
<Notes />
18-
</Workspace>
1+
{
2+
"Uuid": "3c9d0464-8643-5ffe-96e5-ab1769818209",
3+
"IsCustomNode": false,
4+
"Description": "",
5+
"Name": "HelloDynamoSystemTest",
6+
"ElementResolver": {
7+
"ResolutionMap": {}
8+
},
9+
"Inputs": [],
10+
"Outputs": [],
11+
"Nodes": [
12+
{
13+
"ConcreteType": "CoreNodeModels.Watch, CoreNodeModels",
14+
"WatchWidth": 35.0,
15+
"WatchHeight": 38.0,
16+
"Id": "2c4cdf29f078497c86b8fed323f4b77d",
17+
"NodeType": "ExtensionNode",
18+
"Inputs": [
19+
{
20+
"Id": "a249fef4a4ce43ed9fa47a4ace364c8c",
21+
"Name": "",
22+
"Description": "Node to show output from",
23+
"UsingDefaultValue": false,
24+
"Level": 2,
25+
"UseLevels": false,
26+
"KeepListStructure": false
27+
}
28+
],
29+
"Outputs": [
30+
{
31+
"Id": "6bb8cd0394254f268082f176f97a233a",
32+
"Name": "",
33+
"Description": "Node output",
34+
"UsingDefaultValue": false,
35+
"Level": 2,
36+
"UseLevels": false,
37+
"KeepListStructure": false
38+
}
39+
],
40+
"Replication": "Disabled",
41+
"Description": "Visualizes a node's output"
42+
},
43+
{
44+
"ConcreteType": "Dynamo.Graph.Nodes.ZeroTouch.DSFunction, DynamoCore",
45+
"Id": "4964a3edb14b46dd8e614d64fad42128",
46+
"NodeType": "FunctionNode",
47+
"Inputs": [
48+
{
49+
"Id": "2e564722e153444292ce3cf2fd1ea4df",
50+
"Name": "x",
51+
"Description": "Integer value, double value or string\n\nvar[]..[]",
52+
"UsingDefaultValue": false,
53+
"Level": 2,
54+
"UseLevels": false,
55+
"KeepListStructure": false
56+
},
57+
{
58+
"Id": "c878418229554a8081a2add69a669b4c",
59+
"Name": "y",
60+
"Description": "Integer value, double value or string\n\nvar[]..[]",
61+
"UsingDefaultValue": false,
62+
"Level": 2,
63+
"UseLevels": false,
64+
"KeepListStructure": false
65+
}
66+
],
67+
"Outputs": [
68+
{
69+
"Id": "f648d8c8b1b7407eb51174f21f2d4908",
70+
"Name": "var",
71+
"Description": "The sum of two input numbers, or the concatenation of two strings",
72+
"UsingDefaultValue": false,
73+
"Level": 2,
74+
"UseLevels": false,
75+
"KeepListStructure": false
76+
}
77+
],
78+
"FunctionSignature": "+@var[]..[],var[]..[]",
79+
"Replication": "Auto",
80+
"Description": "Returns addition of x and y\n\n+ (x: var[]..[], y: var[]..[]): var[]..[]"
81+
},
82+
{
83+
"ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels",
84+
"NumberType": "Double",
85+
"Id": "77af56fb6e37432485e008870d79cb40",
86+
"NodeType": "NumberInputNode",
87+
"Inputs": [],
88+
"Outputs": [
89+
{
90+
"Id": "982234929f014a7dacf16d38836763a1",
91+
"Name": "",
92+
"Description": "Double",
93+
"UsingDefaultValue": false,
94+
"Level": 2,
95+
"UseLevels": false,
96+
"KeepListStructure": false
97+
}
98+
],
99+
"Replication": "Disabled",
100+
"Description": "Creates a number",
101+
"InputValue": 21.0
102+
},
103+
{
104+
"ConcreteType": "CoreNodeModels.Input.DoubleInput, CoreNodeModels",
105+
"NumberType": "Double",
106+
"Id": "a603bf1480404297bea85441d71645ed",
107+
"NodeType": "NumberInputNode",
108+
"Inputs": [],
109+
"Outputs": [
110+
{
111+
"Id": "e57dc497431840b98db808aca08d846b",
112+
"Name": "",
113+
"Description": "Double",
114+
"UsingDefaultValue": false,
115+
"Level": 2,
116+
"UseLevels": false,
117+
"KeepListStructure": false
118+
}
119+
],
120+
"Replication": "Disabled",
121+
"Description": "Creates a number",
122+
"InputValue": 21.0
123+
}
124+
],
125+
"Connectors": [
126+
{
127+
"Start": "f648d8c8b1b7407eb51174f21f2d4908",
128+
"End": "a249fef4a4ce43ed9fa47a4ace364c8c",
129+
"Id": "b47128bfe4304b74a01f7b8db90d2c34",
130+
"IsHidden": "False"
131+
},
132+
{
133+
"Start": "982234929f014a7dacf16d38836763a1",
134+
"End": "2e564722e153444292ce3cf2fd1ea4df",
135+
"Id": "73b3eba3b10e4b1f86c836c5164e01e9",
136+
"IsHidden": "False"
137+
},
138+
{
139+
"Start": "e57dc497431840b98db808aca08d846b",
140+
"End": "c878418229554a8081a2add69a669b4c",
141+
"Id": "0ebc660b634b4281814460827fd4fa78",
142+
"IsHidden": "False"
143+
}
144+
],
145+
"Dependencies": [],
146+
"NodeLibraryDependencies": [],
147+
"EnableLegacyPolyCurveBehavior": null,
148+
"Thumbnail": null,
149+
"GraphDocumentationURL": null,
150+
"ExtensionWorkspaceData": [
151+
{
152+
"ExtensionGuid": "28992e1d-abb9-417f-8b1b-05e053bee670",
153+
"Name": "Properties",
154+
"Version": "3.1",
155+
"Data": {}
156+
}
157+
],
158+
"Author": "None provided",
159+
"Linting": {
160+
"activeLinter": "None",
161+
"activeLinterId": "7b75fb44-43fd-4631-a878-29f4d5d8399a",
162+
"warningCount": 0,
163+
"errorCount": 0
164+
},
165+
"Bindings": [],
166+
"View": {
167+
"Dynamo": {
168+
"ScaleFactor": 1.0,
169+
"HasRunWithoutCrash": true,
170+
"IsVisibleInDynamoLibrary": true,
171+
"Version": "3.1.0.3755",
172+
"RunType": "Manual",
173+
"RunPeriod": "1000"
174+
},
175+
"Camera": {
176+
"Name": "_Background Preview",
177+
"EyeX": -17.0,
178+
"EyeY": 24.0,
179+
"EyeZ": 50.0,
180+
"LookX": 12.0,
181+
"LookY": -13.0,
182+
"LookZ": -58.0,
183+
"UpX": 0.0,
184+
"UpY": 1.0,
185+
"UpZ": 0.0
186+
},
187+
"ConnectorPins": [],
188+
"NodeViews": [
189+
{
190+
"Id": "2c4cdf29f078497c86b8fed323f4b77d",
191+
"Name": "Watch",
192+
"IsSetAsInput": false,
193+
"IsSetAsOutput": false,
194+
"Excluded": false,
195+
"ShowGeometry": true,
196+
"X": 613.408069206988,
197+
"Y": 243.832684826672
198+
},
199+
{
200+
"Id": "4964a3edb14b46dd8e614d64fad42128",
201+
"Name": "+",
202+
"IsSetAsInput": false,
203+
"IsSetAsOutput": false,
204+
"Excluded": false,
205+
"ShowGeometry": true,
206+
"X": 404.715400784895,
207+
"Y": 238.891755796865
208+
},
209+
{
210+
"Id": "77af56fb6e37432485e008870d79cb40",
211+
"Name": "Number",
212+
"IsSetAsInput": false,
213+
"IsSetAsOutput": false,
214+
"Excluded": false,
215+
"ShowGeometry": true,
216+
"X": 159.40168436709547,
217+
"Y": 106.14571181066069
218+
},
219+
{
220+
"Id": "a603bf1480404297bea85441d71645ed",
221+
"Name": "Number",
222+
"IsSetAsInput": false,
223+
"IsSetAsOutput": false,
224+
"Excluded": false,
225+
"ShowGeometry": true,
226+
"X": 157.2343691937667,
227+
"Y": 282.8144436335819
228+
}
229+
],
230+
"Annotations": [],
231+
"X": 146.89726815586,
232+
"Y": 9.96610837046791,
233+
"Zoom": 1.05281788169755
234+
}
235+
}

src/SampleLibraryTests/HelloDynamoZeroTouchTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ namespace SampleLibraryTests
4444
class HelloDynamoZeroTouchTests : GeometricTestBase
4545
{
4646
[Test]
47+
[Category("NEEDS_GEOM_LIB")]
4748
public void PassingTest()
4849
{
4950
var myObject = Point.ByCoordinates(5, 5, 5);
5051
Assert.NotNull(myObject);
5152
}
5253

5354
[Test]
55+
[Category("NEEDS_GEOM_LIB")]
5456
public void FailingTest()
5557
{
5658
var p1 = Point.ByCoordinates(0, 0, 0);
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
using System.Reflection;
2-
using System.Runtime.CompilerServices;
1+
using NUnit.Framework;
2+
using System.Reflection;
33
using System.Runtime.InteropServices;
4+
using System.Threading;
45

56
// General Information about an assembly is controlled through the following
67
// set of attributes. Change these attribute values to modify the information
78
// associated with an assembly.
89
[assembly: AssemblyTitle("SampleLibraryTests")]
910
[assembly: Guid("c3d8c6fc-62ad-4272-91a9-492be76577e5")]
11+
12+
// The RequiresThread(ApartmentState.STA) attribute is required by
13+
// NUNit to run all tests, that use the UI, on the same thread.
14+
[assembly: RequiresThread(ApartmentState.STA)]

0 commit comments

Comments
 (0)