-
Notifications
You must be signed in to change notification settings - Fork 202
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
Make import / export tests run from core. #595
Conversation
@@ -0,0 +1,262 @@ | |||
//Maya ASCII 2016 scene |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was actually removed by
7cd3c48
Will fix.
cmds.loadPlugin("MASH") | ||
|
||
scene = "InstancerTestMash.ma" | ||
# Choose the test file based on whether the MASH plugin is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, incorrect revert of
7cd3c48
will fix.
@@ -49,8 +48,22 @@ def testExportWithClashStripping(self): | |||
|
|||
usdFilePath = os.path.abspath('UsdExportStripNamespaces_EXPORTED.usda') | |||
|
|||
errorRegexp = "Multiple dag nodes map to the same prim path" \ | |||
".+|cube1 - |foo:cube1.*" | |||
# https://github.com/Autodesk/maya-usd/blob/dev/lib/mayaUsd/fileio/jobs/writeJob.cpp#L814 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Help with this would be appreciated.
Many, many thanks to @HamedSabri-adsk for his help on this branch! |
''' | ||
(testDir, testFile) = _setUpClass(modulePathName) | ||
|
||
return testDir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ppt-adsk This is a great utility. I am wondering if it makes sense to have fixturesUtils.py move out of here to a higher directory ( e.g test\lib\usd ). In case we bring in more pixar tests here, they can also leverage this.
PYTHON_MODULE ${target} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
ENV | ||
"MAYA_DISABLE_CIP=1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can set below two Maya environment variables in test.cmake
, so don't have to worry about setting them every time.
MAYA_DISABLE_CIP=1 Avoid fatal crash on start-up.
MAYA_DISABLE_CER=1 Customer Error Reporting.
These can be added to the list of ENV variables like this:
# without "MAYA_NO_STANDALONE_ATEXIT=1", standalone.uninitialize() will
# set exitcode to 0
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
"MAYA_NO_STANDALONE_ATEXIT=1"
"MAYA_DISABLE_CIP=1"
"MAYA_DISABLE_CER=1")
testUsdExportMesh.py | ||
testUsdExportNurbsCurve.py | ||
testUsdExportOpenLayer.py | ||
testUsdExportOverImport.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ppt-adsk ,
I did a clean build of maya-usd with your changes on Windows. Ran all the tests and ctest reported that all tests pass:
100% tests passed, 0 tests failed out of 104
Label Time Summary:
importExport = 667.42 sec*proc (39 tests)
ufe = 390.75 sec*proc (19 tests)
usdPreviewSurface = 33.33 sec*proc (2 tests)
Total Test time (real) = 85.62 sec
I then ran the tests again but ctest reports that testUsdExportOverImport
failed. Do you see this behavior on your side as well?
Here is what -VV shows:
40: ======================================================================
40: FAIL: testImportModifyAndExportCubeModel (testUsdExportOverImport.testUsdExportOverImport)
40: ----------------------------------------------------------------------
40: Traceback (most recent call last):
40: File "testUsdExportOverImport.py", line 73, in testImportModifyAndExportCubeModel
40: File "testUsdExportOverImport.py", line 50, in _ValidateUsdBeforeExport
40: AssertionError: invalid null prim is not true
40:
40: ----------------------------------------------------------------------
40: Ran 1 test in 0.323s
40:
40: FAILED (failures=1)
1/1 Test #40: testUsdExportOverImport ..........***Failed 6.35 sec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! I do get the same failure. Let me investigate.
@ppt-adsk Great job. You also did a lot of the work here as well. Aside from the testUsdExportOverImport failure and couple of minor comments, everything else looks good to me. Merci |
Thanks for tackling this @ppt-adsk! I unfortunately probably won't get a chance to dig into this in detail until early next week, but I'm excited to check it out! |
@mattyjams no worries, thanks for having a look. |
importExport directory renamed translators at @kxl-adsk 's request, to match library hierarchy and help discoverability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks @ppt-adsk!
Just one request: Can we make the fixturesUtils
changes to the testUsdExportRfMLight.py
test? I don't see any modifications to that file. No need to make sure it actually runs and passes. I can verify that it's working when I merge this internally.
And on that note, fair warning that I may have some small follow-ups to this once I'm able to wrestle our internal build and test system to adapt to these changes. One thing I think might be problematic for us is that we currently install the test scripts in a different location than the test run directory, so I may need to make fixturesUtils.setUpClass()
slightly more flexible to be able to handle that somehow.
shutil.rmtree(outputPath) | ||
|
||
os.mkdir(outputPath) | ||
os.chdir(outputPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious about this, since by the time we hit this we've obviously already launched Maya from some other directory. Would Maya itself possibly still write workspace.mel
or swatch files or other stuff into the run directory, and do we care if so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JGamache-autodesk has suggested the following improvements, which I believe touch upon what you're mentioning:
MAYA_APP_DIR -> should point to somewhere inside that folder. Makes sure tests are always run with fresh user prefs, and allows investigating prefs added or modified by the test.
MAYA_PROJECTS_DIR -> should point to %{ MAYA_APP_DIR}/projects, especially if the test renders to disk using the default output settings or exports a USD scene to the default output path by only specifying a file name.
This is for later improvement, as needed.
# Unfortunately, at time of writing, this is not happening correctly, | ||
# as the Python exception is generated, but the detailed error string | ||
# is lost. We are left with the the generic 'Maya command error' | ||
# string, which is far weaker. PPT, 16-Jun-20. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting. This test passes currently with the original regex, so was the problem caused by the file moves somehow?
Is there an issue open for this, or can we create one if not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent suggestion:
#601
cmds.loadPlugin('pxrUsd') | ||
cmds.usdImport(file=usdFilePath, shadingMode='pxrRis', | ||
readAnimData=True) | ||
usdFilePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "UsdImportRfMLightTest", "RfMLightsTest.usda") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using fixtureUtils
for this?
Thanks @mattyjams for the review!
Done, see
That sounds like a great improvement. |
Thanks @ppt-adsk! I think 5d1f558 covers |
This pull request moves the majority of import / export tests down to the maya-usd core, and has them run using the mayaUsdPlugin. Only those tests that have a dependence on the Pixar plugin (for Maya scene assembly support) were kept in the Pixar plugin subtree.