Running tests with a user name with numbers fails tests
bziemons opened this issue · comments
Running python ulwgl_test.py
as a user without a pure alphabetic name (e.g. user3
) does not currently work.
I tried pinpointing the issue and it seems to be related to regular expressions like these: https://github.com/Open-Wine-Components/ULWGL-launcher/blob/33bd82851aba4106851523cd952511ead0057da2/ulwgl_test.py#L906
In general, the actual user home directory should not be of any concern to successfully running tests and this regex doesn't suffice for all cases of user home directories (numbers in user name, having the home directory outside of /home
, …).
The tests give the following output:
./tmp.WMYQiPb9A
...ULWGL-Proton-5HYdpddgvs.tar.gz found in: tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz
Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
..Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
ULWGL-Proton-5HYdpddgvs.tar.gz found in: tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz
Purging ULWGL-Proton-5HYdpddgvs in tmp.ZssGZoiNod ...
.ULWGL-Proton-foo.tar.gz found in: tmp.5HYdpddgvs/ULWGL-Proton-foo.tar.gz
Extracting tmp.5HYdpddgvs/ULWGL-Proton-foo.tar.gz -> tmp.ZssGZoiNod ...
Completed.
.Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
Keyboard Interrupt.
Cleaning ...
Purging ULWGL-Proton-5HYdpddgvs.tar.gz in tmp.5HYdpddgvs ...
Purging ULWGL-Proton-5HYdpddgvs in tmp.ZssGZoiNod ...
.Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
Keyboard Interrupt.
Cleaning ...
.
../tmp.WMYQiPb9A
..E
.../tmp.WMYQiPb9A
.Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
.../tmp.WMYQiPb9A
.Extracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
Fetching latest release ...
Keyboard Interrupt.
Cleaning ...
Purging ULWGL-Proton-5HYdpddgvs.tar.gz in tmp.5HYdpddgvs ...
Purging ULWGL-Proton-5HYdpddgvs in tmp.ZssGZoiNod ...
..Fetching latest release ...
.usage: ulwgl_test.py [-h] [--config CONFIG]
Unified Linux Wine Game Launcher
options:
-h, --help show this help message and exit
--config CONFIG path to TOML file
example usage:
WINEPREFIX= GAMEID= PROTONPATH= ulwgl_run.py /home/foo/example.exe
WINEPREFIX= GAMEID= PROTONPATH= ulwgl_run.py /home/foo/example.exe -opengl
WINEPREFIX= GAMEID= PROTONPATH= ulwgl_run.py ""
WINEPREFIX= GAMEID= PROTONPATH= PROTON_VERB= ulwgl_run.py /home/foo/example.exe
WINEPREFIX= GAMEID= PROTONPATH= STORE= ulwgl_run.py /home/foo/example.exe
ulwgl_run.py --config /home/foo/example.toml
.../tmp.WMYQiPb9A
../tmp.WMYQiPb9A
../tmp.WMYQiPb9A
.......E..E.EExtracting tmp.5HYdpddgvs/ULWGL-Proton-5HYdpddgvs.tar.gz -> tmp.ZssGZoiNod ...
Completed.
ULWGL-Proton-5HYdpddgvs found in: tmp.ZssGZoiNod
..
======================================================================
ERROR: test_env_vars_paths (__main__.TestGameLauncher.test_env_vars_paths)
Test check_env when setting unexpanded paths for $WINEPREFIX and $PROTONPATH.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_test.py", line 1502, in test_env_vars_paths
result = ulwgl_run.check_env(self.env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_run.py", line 110, in check_env
if not Path(os.environ["WINEPREFIX"]).expanduser().is_dir():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1385, in expanduser
raise RuntimeError("Could not determine home directory.")
RuntimeError: Could not determine home directory.
======================================================================
ERROR: test_set_env_toml_paths (__main__.TestGameLauncher.test_set_env_toml_paths)
Test set_env_toml when specifying unexpanded file path values in the config file.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_test.py", line 940, in test_set_env_toml_paths
Path(toml_path).expanduser().touch()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1385, in expanduser
raise RuntimeError("Could not determine home directory.")
RuntimeError: Could not determine home directory.
======================================================================
ERROR: test_setup_pfx_mv (__main__.TestGameLauncher.test_setup_pfx_mv)
Test setup_pfx when moving the WINEPREFIX after creating it.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_test.py", line 1288, in test_setup_pfx_mv
result = ulwgl_run.setup_pfx(unexpanded_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_run.py", line 49, in setup_pfx
pfx: Path = Path(path).joinpath("pfx").expanduser()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1385, in expanduser
raise RuntimeError("Could not determine home directory.")
RuntimeError: Could not determine home directory.
======================================================================
ERROR: test_setup_pfx_symlinks (__main__.TestGameLauncher.test_setup_pfx_symlinks)
Test _setup_pfx for valid symlinks.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_test.py", line 1354, in test_setup_pfx_symlinks
result = ulwgl_run.setup_pfx(unexpanded_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user3/ulwgl-git/src/ULWGL-launcher/ulwgl_run.py", line 49, in setup_pfx
pfx: Path = Path(path).joinpath("pfx").expanduser()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/pathlib.py", line 1385, in expanduser
raise RuntimeError("Could not determine home directory.")
RuntimeError: Could not determine home directory.
----------------------------------------------------------------------
Ran 41 tests in 0.061s
FAILED (errors=4)