Skip to content

MAGN-8735 Re-enable Visualization tests and move into shared assembly. Update job on CI to target new visualization assembly.#5431

Merged
ikeough merged 19 commits intoDynamoDS:masterfrom
ikeough:MAGN-8735
Oct 12, 2015
Merged

MAGN-8735 Re-enable Visualization tests and move into shared assembly. Update job on CI to target new visualization assembly.#5431
ikeough merged 19 commits intoDynamoDS:masterfrom
ikeough:MAGN-8735

Conversation

@ikeough
Copy link
Contributor

@ikeough ikeough commented Oct 4, 2015

Purpose

During the recent addition of an updated HelixWatch3DViewModel component, 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.IsTestMode and conditionally creating the view, with a more robust solution where the type of Watch3DViewModel is passed into the constructor of the DynamoViewModel through the StartupParams. By default, a DefaultWatch3DViewModel will 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 a HelixWatch3DViewModel which does render.

A new static constructor has been added,HelixWatch3DViewModel.TryCreateHelixWatch3DViewModel(...). This method of construction attempts to create a valid HelixWatch3DViewModel, and if it cannot be created due to the lack of resources on the client, a DefaultWatch3DViewModel is 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 class VisualizationTest constructs the DynamoViewModel using a HelixWatch3DViewModel and 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.
image
Dynamo starts with the background preview disabled. The background preview selection is disabledin the View menu as well.
image
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:
image

Related PRs:

DynamoDS/DynamoRevit#681

Declarations

Check these if you believe they are true

  • The code base is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files

Reviewers

@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

Ian Keough added 3 commits October 4, 2015 11:47
- 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.
@ikeough ikeough added the WIP label Oct 4, 2015
@ikeough ikeough self-assigned this Oct 4, 2015
Ian Keough added 5 commits October 5, 2015 11:22
- 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
Copy link
Member

Choose a reason for hiding this comment

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

should still be marked failure and TODO?

@mjkkirschner
Copy link
Member

@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?

Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing should require update in the mono solution. But I'll double check.

UPDATE:
Double checked the mono solution. No updates required.

Ian Keough added 4 commits October 9, 2015 09:14
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
@ikeough ikeough assigned mjkkirschner and unassigned ikeough Oct 9, 2015
Copy link
Member

Choose a reason for hiding this comment

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

should this be pointing to some resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. This is not visible in the UI.

Copy link
Member

Choose a reason for hiding this comment

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

can you add a comment as to why showing edges requires regenerating all packages?

@ikeough
Copy link
Contributor Author

ikeough commented Oct 9, 2015

@mjkkirschner The self-service CI is running clean.

Copy link
Member

Choose a reason for hiding this comment

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

could view potentially be null?

@mjkkirschner
Copy link
Member

@ikeough this looks good to me besides updating the 2012 .sln and one potential null check

Conflicts:
	src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs
ikeough pushed a commit that referenced this pull request Oct 12, 2015
MAGN-8735 Re-enable Visualization tests and move into shared assembly. Update job on CI to target new visualization assembly.
@ikeough ikeough merged commit c72fe06 into DynamoDS:master Oct 12, 2015
@ikeough ikeough deleted the MAGN-8735 branch October 12, 2015 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PTAL Please Take A Look 👀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants