DavidoTek / ProtonUp-Qt

Install and manage GE-Proton, Luxtorpeda & more for Steam and Wine-GE & more for Lutris with this graphical user interface.
https://davidotek.github.io/protonup-qt
GNU General Public License v3.0
1.16k stars 39 forks source link

Add Unit Testing Workflow using PyTest #400

Open DavidoTek opened 1 month ago

DavidoTek commented 1 month ago

Fix https://github.com/DavidoTek/ProtonUp-Qt/issues/347


Fixed Qt import for PyTest by installing libEGL and libxcbcommon and setting QT_QPA_PLATFORM=offscreen **Previously**: Currently fails due to missing `libEGL`, i.e. the runner is headless but the Qt imports expect a graphics library. I will investigate that. ```sql ==================================== ERRORS ==================================== _____________________ ERROR collecting tests/test_util.py ______________________ ImportError while importing test module '/home/runner/work/ProtonUp-Qt/ProtonUp-Qt/tests/test_util.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_util.py:1: in from pupgui2.util import * pupgui2/util.py:20: in from PySide6.QtWidgets import QApplication, QStyleFactory, QMessageBox, QCheckBox E ImportError: libEGL.so.1: cannot open shared object file: No such file or directory ---------------- generated Markdown report: /tmp/tmp.t8xQFKNH8p ---------------- ```