MAGN-8735 Re-enable Visualization tests and move into shared assembly. Update job on CI to target new visualization assembly.#5431
Conversation
- Move all tests requiring a proper visualization context to a separate assembly whose tests can be run on a properly configured machine. - Adjust the DynamoViewModel class so that one can inject a Watch3DViewModel. By default, a Watch3DViewModelBase is created. For sandbox (and for Revit), a HelixWatch3DViewModel will be created. - Fix one broken visualization test that was broken due to the way that we now create the Watch3DView in the code behind.
- Make Name property setting internal to constructor. Each Watch3DViewModel will set its own name. - Remove the INotifyPropertyChanged input to Watch3DViewModel.Setup. Replace with a method RegenerateAllPackages() which forces a regeneration of all packages. Make the DynamoViewModel call this method when the "ShowEdges" flag is changed.
Conflicts: src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
Conflicts: src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
There was a problem hiding this comment.
should still be marked failure and TODO?
|
@ikeough it looks like there are some conflicts now, I've looked through the changes here and will need a another look to understand them all, but can you fix the conflicts before I take another look? |
There was a problem hiding this comment.
can you also make these changes to the 2012 .sln since at this time it is still around....
I know these are wpf changes - but is there anything that will need to be updated in the mono solution?
There was a problem hiding this comment.
Nothing should require update in the mono solution. But I'll double check.
UPDATE:
Double checked the mono solution. No updates required.
Conflicts: src/DynamoCoreWpf/ViewModels/Watch3D/DefaultWatch3DViewModel.cs src/DynamoCoreWpf/ViewModels/Watch3D/HelixWatch3DViewModel.cs src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs
Conflicts: src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs src/DynamoCore/Properties/AssemblyInfo.cs
There was a problem hiding this comment.
should this be pointing to some resource?
There was a problem hiding this comment.
No. This is not visible in the UI.
There was a problem hiding this comment.
can you add a comment as to why showing edges requires regenerating all packages?
|
@mjkkirschner The self-service CI is running clean. |
There was a problem hiding this comment.
could view potentially be null?
|
@ikeough this looks good to me besides updating the 2012 .sln and one potential null check |
Conflicts: src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
MAGN-8735 Re-enable Visualization tests and move into shared assembly. Update job on CI to target new visualization assembly.
Purpose
During the recent addition of an updated
HelixWatch3DViewModelcomponent, it was found that, on our CI systems, we could not create a rendering context during system testing due to the lack of DirectX 10 features on the test machines. A temporary solution was enacted to shut off the creation of the background preview when running tests. But for a number of tests, a proper rendering context is required. These tests were marked as failures in order to get the build running again.This PR replaces the temporary solution, checking for
DynamoModel.IsTestModeand conditionally creating the view, with a more robust solution where the type ofWatch3DViewModelis passed into the constructor of theDynamoViewModelthrough theStartupParams. By default, aDefaultWatch3DViewModelwill be created which allows for the running of system tests, but does not actually render anything. For sandbox, Revit, and the visualization tests, we inject aHelixWatch3DViewModelwhich does render.A new static constructor has been added,
HelixWatch3DViewModel.TryCreateHelixWatch3DViewModel(...). This method of construction attempts to create a validHelixWatch3DViewModel, and if it cannot be created due to the lack of resources on the client, aDefaultWatch3DViewModelis created, a message is logged to the console, and the exception is written to the log.All tests requiring a full 3d rendering context are moved to a new assembly,
WpfVisualizationTests, where a new base classVisualizationTestconstructs theDynamoViewModelusing aHelixWatch3DViewModeland thus establishing a proper rendering context.To test this functionality, we can use the DirectX debugging tools. When we set the "Feature Level limit" to 9_3, and we start Dynamo.



Dynamo starts with the background preview disabled. The background preview selection is disabledin the View menu as well.
Turning off the feature level limit, and restarting Dynamo puts us, once again, into the mode where the background preview is disabled, as this was the last saved state. Enabling the background preview in the view model returns us to 3D:
Related PRs:
DynamoDS/DynamoRevit#681
Declarations
Check these if you believe they are true
*.resxfilesReviewers
@mjkkirschner
FYIs
@aparajit-pratap These changes affect the work you are doing in #5418
@limrzx - The existing visualization tests on the CI, will now need to run tests from the
WpfVisualizationTests.dll