rez
rez copied to clipboard
some shell tests are failing on windows 10
Describe the bug here.
Environment
- Microsoft Windows 10 Enterprise - 10.0.19043
- rez v2.109.0, py3.10
- powershell v5.1.19041.1682
To Reproduce
- run rez-selftest
Expected behavior Tests all pass
Actual behavior Two shell tests fail in cwd / powershell. Unsure as to why CI windows workflow is passing.
Test output:
----------------------------------------------------------------------
File "c:\users\aljohns\rez\lib\site-packages\rez\tests\test_shells.py", line 173, in test_command
AssertionError: '' != 'Hello Rez World!'
+ Hello Rez World! (in shell 'powershell')
======================================================================
FAIL: test_command_returncode (rez.tests.test_shells.TestShells)
----------------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\aljohns\rez\lib\site-packages\rez\tests\util.py", line 241, in wrapper
File "c:\users\aljohns\rez\lib\site-packages\rez\tests\test_shells.py", line 187, in test_command_returncode
----------------------------------------------------------------------
Ran 218 tests in 87.727s
Note - the tests PASS (both powershell and cmd) if the same shell command as the windows workflow is used:
]$ powershell.exe -NoLogo -NoProfile -ExecutionPolicy ByPass
]$ rez-selftest
Any powershell gurus know why this would be?
Update: Now the tests always pass regardless..?
I can take a look this week. For reference i did fight Windows tests a bit back while working on tests for different PRs and there are some weird gotchas on windows due to the lack of shebang support. The environment needs to be set up to run .py files with python. If this is changed once, you can not easily change it to the original setup (which includes forwarding any parameters, if you use the GUI to have .py files be executed with any python executable that will be omitted and failure is incoming). This should not be an issue in an automated setup, but it yielded a similar result due to my machine having .py files wired to vscode. So when the test would run the python script that would not trigger the script to be run with python but open vscode. There is so much subtle (and not so subtle) difference between CI Windows setups and local machines :(
I think -NoLogo helped for me in a case where the test would parse the output to be empty, but running powershell without -NoLogo prints version information and some more things.
As said will take a look this week, might be towards the second half though.