Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for the Dynamo 3.0 release #50

Merged
merged 11 commits into from
Jan 11, 2024
Merged

update for the Dynamo 3.0 release #50

merged 11 commits into from
Jan 11, 2024

Conversation

pinzart90
Copy link
Contributor

@pinzart90 pinzart90 commented Dec 11, 2023

Changed how tests are run:
The resolver in Dynamo test infrastructure is broken (missing resolver paths for the main dynamo assemblies and for resources)
Added a custom resolver in the test.

@pinzart90 pinzart90 marked this pull request as ready for review December 12, 2023 14:31
List<string> resolutionPaths;

[OneTimeSetUp]
public void RunBeforeAllTests()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this - I do hope we can come up with something better long term though. I believe there is a task in the backlog for it.

One thing we explored in the past was pulling full dynamo builds directly from s3 - that worked pretty well. There was even a msbuild task for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having dynamo (runtime) installed on the test machine + 3dParty tests pointing to that install path sounds like a good approach .
Maybe the 3dparty dev should make sure to install dynamocore on the build machine (not sure if we should do it as part of the test project build process)
But if we do want to provide this convenience, we could also include a script as part of the test nuget, that the user could use to download a specific version of dynamo (runtime) and set the proper paths in the test config file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a good idea for our test framework too (in order to segregate test deps from the runtime), separate out all the tests in a new solution and all tests would have a resolver to point to the dynamo output folder

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do install dynamo runtime as part of tests in other places (e.g. GD repos).

@@ -56,7 +56,7 @@ public static TraceExampleItem ByString(string description)

TraceExampleItem item = null;

int id;
string id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of changing these types, you could just serialize and parse as it's just an int, or illustrate serialization using system.text.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<PackageXml Include="$(OutputPath)SampleLinter_ExtensionDefinition.xml" />
<SettingsXml Include="$(OutputPath)LinterSettings.xml" />
</ItemGroup>
<Copy SourceFiles="@(PackageDll)" DestinationFolder="$(ProjectDir)..\..\dynamo_linter\Sample Linter\bin" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the structure of this output path - does it live in the package output folder? Is it a separate package from the main samples one, or is it in the same package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a separate dynamo_linter folder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These packages are not exactly published, are they? Are they simply there for testing in Dynamo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know if anyone has published these packages (manually ?). There is no automation for it.
From the looks of it, it is there just to provide an example of how to build a package/linter/extension.
I do not think we have an example for the publishing process

run: echo "::remove-matcher owner=csc::"
- name: Install dependencies for SampleIntegration
run: |
dotnet restore $Env:GITHUB_WORKSPACE\DynamoSamples\src\SampleIntegration\SampleIntegration.sln /p:Configuration=Release --runtime=win-x64 -p:DotNet=net8.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is -p:DotNet=... the same as /p:DotNet=...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes..but dotnet restore has a different format for properties than msbuild

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, why are you using both formats here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need the -p:DotNet=net8.0 here. Removed
Looks like dotnet restore requires /p: for supplying properties
--runtime=win-x64 is separate from properties.

<add key="RequestedLibraryVersion" value="Version223"/>
</appSettings>
<appSettings>
<add key="DynamoBasePath" value="D:\dev\dynamo\DynamoDS\bin\AnyCPU\debug"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously, this is not meant for CICD, is there CICD setup for this project?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

<ItemGroup>
<PackageFiles Include="$(OutDir)\SampleLibraryUI.dll;$(OutDir)\SampleLibraryUI.XML;$(OutDir)\SampleLibraryUI.dll.config" />
<PackageFiles Include="$(OutDir)\SampleLibraryUI.dll;$(OutDir)\SampleLibraryUI.XML" />
<ENResourceFiles Include="$(OutDir)\en-US\*.*" />
<ESResourceFiles Include="$(OutDir)\es-ES\*.*" />
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I'm having difficulty getting these afterbuild targets to run in Meshtoolkit

Copy link
Contributor

@aparajit-pratap aparajit-pratap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments, and some questions, then LGTM.

@pinzart90
Copy link
Contributor Author

Needs to consume Dynamo nugets after this PR goes in DynamoDS/Dynamo#14774

<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<PlatformTarget >x64</PlatformTarget>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<TargetFramework>net8.0</TargetFramework>
<FileAlignment>512</FileAlignment>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed for all projects? I guess it's not that important now but it would be nice if our ZT and extension samples could run on linux builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<EnableDynamicLoading>true</EnableDynamicLoading>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because this is a sample and this is a pretty rare property, maybe add a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<TargetFramework>net8.0-windows</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are worth adding comments for so that sample users don't blindly add these to their repos if they don't need them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<Target Name="AfterBuild">
</Target>
<ItemGroup>
<PackageReference Include="DynamoVisualProgramming.Tests" Version="1.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.0.0 ? Is this a local build?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes...will change once I have the dynamo nugets

<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\$(UICulture)\SampleLibraryUI.XML</DocumentationFile>
<Prefer32Bit>false</Prefer32Bit>
<TargetFramework>net8.0-windows</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yada yada, this is a UI project that references wpf so add these properties

Copy link
Member

@mjkkirschner mjkkirschner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a few comments but looks good.

public void RunBeforeAllTests()
{
var thisDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var configPath = Path.Combine(thisDir, "TestServices.dll.config");
Copy link
Contributor

@aparajit-pratap aparajit-pratap Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this config file is in the test nuget package that is a dependency of dynamosamples from the work done in DynamoDS/Dynamo#14774?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YEs. And ideally the content of this file (Setup.cs) would live in the SystemTestServices.dll (or somewhere in Dynamo). But I found it too complicated to do it now

Copy link
Contributor

@aparajit-pratap aparajit-pratap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one last question, LGTM!

@mjkkirschner
Copy link
Member

@pinzart90 looks like there are some build failures due to nunit API changes?

@pinzart90
Copy link
Contributor Author

@pinzart90 looks like there are some build failures due to nunit API changes?

Yeah, nunit should come with dynamotests. Waiting for the nuggets

@pinzart90 pinzart90 merged commit 62c0c33 into master Jan 11, 2024
10 checks passed
@pinzart90 pinzart90 deleted the update_3.0 branch January 11, 2024 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants