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

Refactored test case plugin loading and unloading. #204

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

ppt-adsk
Copy link
Collaborator

There was duplication of infrastructure for loading plugins needed for a test, and unloading them afterwards. This has been removed, and the union of the support was kept, including the _requiredPlugins Python class variable that is presented in the Markdown documentation.

@ppt-adsk ppt-adsk self-assigned this Nov 19, 2024

def createScene(self):
self._locator = cmds.createNode('MhFlowViewportAPILocator')
cmds.setAttr(self._locator + '.numCubesX', 3)
cmds.setAttr(self._locator + '.numCubesY', 3)
cmds.setAttr(self._locator + '.numCubesZ', 3)

@classmethod
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the duplication, brought back to the base class.

@@ -94,6 +97,12 @@ def setUp(self):

@classmethod
def tearDownClass(cls):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Base class now unloads plugins that were loaded specifically for the test.

# Clean out the scene to allow all plugins to unload cleanly.
cmds.file(new=True, force=True)
for p in reversed(cls._pluginsToUnload):
if p != 'mayaHydraFlowViewportAPILocator':
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unloading this plugin crashes, entered as HYDRA-1304.

@ppt-adsk ppt-adsk added the test label Nov 19, 2024
lilike-adsk
lilike-adsk previously approved these changes Nov 19, 2024
Copy link
Collaborator

@lilike-adsk lilike-adsk left a comment

Choose a reason for hiding this comment

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

Nice cleanup!

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 19, 2024
@lilike-adsk lilike-adsk merged commit 9fb2506 into dev Nov 19, 2024
10 checks passed
@lilike-adsk lilike-adsk deleted the tremblp/HYDRA-1083/test_case_plugin_load_refactoring branch November 19, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants