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

Migrate more tests from plugin/pxr to core mayaUsd #1042

Merged

Conversation

mattyjams
Copy link
Contributor

All of these tests exercise functionality that is in mayaUsd itself and not specific to the pxrUsd plugin or other code in plugin/pxr.

This is in the continuing effort to thin out the plugin/pxr code leaving behind only the assembly-related stuff that we intend to ultimately get rid of.

@mattyjams mattyjams added the unit test Related to unit tests (both python or c++) label Jan 6, 2021

@classmethod
def tearDownClass(cls):
standalone.uninitialize()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You may want to exclude commit 8e39493fd99d192f130e9d360f30c4b29255c548 or otherwise ignore whitespace when looking through this PR, since it causes GitHub to identify testXformStack.py as a "large diff".

@mattyjams mattyjams requested review from kxl-adsk and removed request for kxl-adsk January 7, 2021 02:39
@mattyjams mattyjams force-pushed the pr/migrate_more_pxr_usdMaya_tests_to_core branch from 8e39493 to 88ed166 Compare January 7, 2021 02:45
@mattyjams
Copy link
Contributor Author

Rebased to resolve conflicts from the merge of #1039.

Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

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

Thank you for continuing this migration, Matt. Not many comments from my side but I stopped for a second on testProxyShape. We want this test to only validate features of the base proxy shape class and studio-specific features should be tested in separate test files. To communicate this intent, how about we rename this test to testProxyShapeBase and operate on proxyShapeBase node (i.e. mayaUsdProxyShapeBase instead of mayaUsdProxyShape)

…as testBlockSceneModificationContext

The UsdMayaBlockSceneModificationContext class that this test exercises is
provided by mayaUsd itself and is not specific to the pxr plugin.
…nosticDelegate

The UsdMayaDiagnosticDelegate class that this test exercises is provided by
mayaUsd itself and is not specific to the pxr plugin.
This test is applicable to all flavors of mayaUsdProxyShapeBase. Though it is
by no means an exhaustive test in its current form, it provides a base that can
be extended with additional tests for the base proxy shape that is common to
all derived proxy shapes. Tests for functionality specific to derived proxy
shapes should go in separate tests.
@mattyjams mattyjams force-pushed the pr/migrate_more_pxr_usdMaya_tests_to_core branch from 88ed166 to c00ce41 Compare January 7, 2021 18:19
@mattyjams
Copy link
Contributor Author

Thanks @kxl-adsk! Good catch. I just rebased the changes and addressed your proxy shape base note in 6420c88.

Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

…nto testHdImagingShape

The pxrHdImagingShape is only used when using the legacy Pixar batch renderer
and the Viewport 2.0 render delegate is disabled. It is also only created by
default when using mayaUsdProxyShape nodes, not mayaUsdProxyShapeBase.

This separates out pxrHdImagingShape-related testing into its own dedicated
test script.
…eUtils

This test exercises utilities in UsdMayaReadUtil and UsdMayaWriteUtil which are
provided by mayaUsd itself and are not specific to the pxr plugin.
…s as testUsdExportUserTaggedAttributes

Though the simple UI for tagging attributes for export still currently lives in
the pxr plugin, the support for interpreting that tagging and exporting the
tagged attributes is part of the mayaUsd core.
This test exercises UsdMayaXformStack and its related classes which are
provided by mayaUsd itself and are not specific to the pxr plugin.
@mattyjams mattyjams force-pushed the pr/migrate_more_pxr_usdMaya_tests_to_core branch from c00ce41 to 8b77381 Compare January 7, 2021 23:15
@mattyjams
Copy link
Contributor Author

Hopefully one last amendment to this: I separated out all of the pxrHdImagingShape-related stuff into its own dedicated test in a8cb370. While mayaUsdProxyShape will automatically create a pxrHdImagingShape when the Viewport 2.0 render delegate is disabled, mayaUsdProxyShapeBase will not (and should not, since it is also the base type for the Animal Logic proxy shape).

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 8, 2021
Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

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

LGTM!

@kxl-adsk kxl-adsk merged commit 3104083 into Autodesk:dev Jan 8, 2021
@mattyjams mattyjams deleted the pr/migrate_more_pxr_usdMaya_tests_to_core branch January 8, 2021 17:46
mattyjams added a commit to mattyjams/maya-usd that referenced this pull request Jan 8, 2021
…ng the test

This is a follow-up fix to a change I made in Autodesk#1042 that replaced the
"__main__" module name included as part of a coding error message with
"testDiagnosticDelegate" instead. While this is correct for the way the test is
run using the mayaUsd CMake testing infrastructure, it is not correct in all
cases.

When the test is executed as a result of the unittest.main() call at the bottom
of the file (e.g. when the script is executed directly via its shebang, when
the script file is passed to a Python interpreter on the command-line, or when
the script file's contents is read and executed through compile() and exec(),
the module will be reported as "__main__". Otherwise, when the file is imported
as a module and then executed using unittest.main(module=<module name>), the
module name will match the file name and be reported as
"testDiagnosticDelegate".

To preserve the extra detail in the test, the regex used to match against the
exception message was updated to recognize both cases.
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 unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants