-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Autodesk: Use TfNormPath to fix TfPathUtils test failures on Windows #2476
Autodesk: Use TfNormPath to fix TfPathUtils test failures on Windows #2476
Conversation
Filed as internal issue #USD-8406 |
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.
Thanks for submitting the PR.
Added a note about using "ARCH_OS_WINDOWS" for the test updates as the test fixups are required for windows only.
Also in an internal review, we were wondering if you can provide an example of a path which fails, just in case there are any code improvements we can do to mitigate this specific case?
Thanks
@@ -104,11 +104,11 @@ TestTfRealPath() | |||
|
|||
if (testSymlinks) { | |||
// Leaf dir is symlink | |||
TF_AXIOM(TfRealPath("d", true) == TfAbsPath("subdir")); | |||
TF_AXIOM(TfNormPath(TfRealPath("d", true)) == TfNormPath(TfAbsPath("subdir"))); |
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.
Since the updates here are primarily to fix the test on windows and the failure is not noticed on linux or macOS, it was mentioned in an internal review if we can split and add some ARCH_OS_WINDOWS guards for these updates?
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.
Thanks a lot for your comments. We'll wrap these changes under ARCH_OS_WINDOWS and add some comments as well.
The reason is that TfRealPath on windows explicitly lower-cases drive letters if the given path contains symlinks, otherwise it returns the same as os.path.abspath. The similar workaround is already used in pxr/base/tf/testenv/testTfPathUtils.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.
Branch updated. @tallytalwar - let us know if this works or if you need any more follow-up.
Description of Change(s)
Unit tests were failing on our Windows setup due to path issues. Wrap with TfNormPath.
Fixes Issue(s)