From 6c5ee69942b04124f927c11d4a0de8ad22610545 Mon Sep 17 00:00:00 2001 From: Jesper Mathiassen Date: Sat, 29 Jun 2024 12:47:09 +0200 Subject: [PATCH] Attempt to run display linked tests in github --- .github/workflows/run_test.yml | 5 +++++ src/executor/executer_pico.py | 1 - tests/test_controller.py | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_test.yml b/.github/workflows/run_test.yml index 6c2a604..ea3ff24 100644 --- a/.github/workflows/run_test.yml +++ b/.github/workflows/run_test.yml @@ -20,6 +20,11 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Start virtual display + run: | + pip install pyvirtualdisplay + export DISPLAY=:99.0 + Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - name: Lint with Ruff run: | pip install ruff diff --git a/src/executor/executer_pico.py b/src/executor/executer_pico.py index 97e6693..50daebc 100644 --- a/src/executor/executer_pico.py +++ b/src/executor/executer_pico.py @@ -2,7 +2,6 @@ import utilities import constants from src.view.view_base import SettingsItem, MenuItem -import struct from src.executor.executer_utilities import ExecuterUtilities import serial diff --git a/tests/test_controller.py b/tests/test_controller.py index 5a561ea..8b59c3f 100644 --- a/tests/test_controller.py +++ b/tests/test_controller.py @@ -3,6 +3,8 @@ # from src.executor.executer_pyautogui import PyAutoGuiExecuter # from src.executor.executer_pynput import PynputExecuter from src.executor.executer_pico import PicoPassthroughExecuter +from src.executor.executer_pyautogui import PyAutoGuiExecuter +from src.executor.executer_pynput import PynputExecuter from src.executor.executer_xdotool import XdotoolExecuter from src.loadouts import LoadoutManager from src.settings import SettingsManager @@ -43,9 +45,8 @@ def test_controller_should_initialize_correctly(model_mock): @pytest.mark.parametrize("executor_constant, executor_class", [ (constants.EXECUTOR_ARDUINO, ArduinoPassthroughExecuter), - ## Causes failure in Github due to missing display - # (constants.EXECUTOR_PYAUTOGUI, PyAutoGuiExecuter), - # (constants.EXECUTOR_PYNPUT, PynputExecuter), + (constants.EXECUTOR_PYAUTOGUI, PyAutoGuiExecuter), + (constants.EXECUTOR_PYNPUT, PynputExecuter), (constants.EXECUTOR_PICO, PicoPassthroughExecuter), (constants.EXECUTOR_XDOTOOL, XdotoolExecuter) ])