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

set $MAYA_APP_DIR before running tests, to use a default maya profile #209

Merged

Conversation

pmolodo
Copy link
Contributor

@pmolodo pmolodo commented May 5, 2017

Description of Change(s)

in testWrapper.py, set the $MAYA_APP_DIR env var, so that maya tests run using a default user profile

Included Commit(s)

Fixes Issue(s)

  • We were experiencing some crashes when running the tests on maya-2017, due to some problems with the color-management settings in the user profile

@jtran56
Copy link

jtran56 commented Jun 2, 2017

Filed as internal issue #147137.

@sunyab
Copy link
Contributor

sunyab commented Jun 13, 2017

Hey @elrond79, at the moment we'd prefer to keep library or plugin-specific environment variables out of testWrapper.py. Can we add MAYA_APP_DIR to the tests in usdMaya/CMakeLists.txt and pxrUsd/CMakeLists.txt instead, just like we do for MAYA_DISABLE_CIP? It's more boilerplate (which we can maybe move to a macro or something later) but it makes it less mysterious what environment is set when the tests are run.

I guess the one tricky bit is that in testWrapper.py, you can set MAYA_APP_DIR to the temporary test directory, which you can't really do in the CMakeLists.txt. However, would it work to set MAYA_APP_DIR to a relative path, like "./maya_profile" instead?

@pmolodo
Copy link
Contributor Author

pmolodo commented Jun 14, 2017

Makes sense - moved it into the CMakeLists.txt files. I checked and confirmed that maya will use relative paths for MAYA_APP_DIR. Latest commit should have these changes!

@sunyab sunyab changed the base branch from master to dev August 8, 2017 01:15
@sunyab
Copy link
Contributor

sunyab commented Aug 8, 2017

Just wanted to provide an update: I tried merging these changes earlier but the Maya tests on MacOS and Windows with Maya 2017 failed with the following errors:

On MacOS:
*** Fatal Error: Failed creating directory: ./maya_profile

On Windows:
*** Fatal Error: Failed creating directory: ./maya_profile/2017/prefs/icons
(It's able to create the maya_profile directory but not a subdirectory beneath it? Weird.)

On Linux, everything worked as expected.

Running the test using an absolute path for MAYA_APP_DIR seemed to work in all cases, so it seems like support for relative paths is inconsistent at best. I wonder if another possible solution is to have testWrapper.py do some kind of substitution; for example, if it gets passed a parameter like $TESTDIR/maya_profile, it'll substitute $TESTDIR with the temporary test directory. Still thinking about this one, though.

@pmolodo
Copy link
Contributor Author

pmolodo commented Apr 11, 2018

So, I fixed it along the lines you suggested - I altered testWrapper.py to automatically replace <PXR_TEST_DIR> in any --env-var args passed into it. Decided to go with <NAME> syntax instead of $NAME because I wanted it to be distinct from env vars or CMake vars, to avoid confusion, but I don't feel strongly about that... we can use whatever syntax or var name you prefer.

@pixar-oss pixar-oss merged commit b92a4d5 into PixarAnimationStudios:dev Apr 21, 2018
pixar-oss added a commit that referenced this pull request Apr 21, 2018
set $MAYA_APP_DIR before running tests, to use a default maya profile
@pmolodo pmolodo deleted the tests_set_maya_app_dir branch March 12, 2019 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants