diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 789deab..60ba7e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: Run tests when PR is created on: issue_comment: types: [created] + pull_request: + types: [opened,reopened] jobs: run-tests: @@ -25,7 +27,7 @@ jobs: - name: Install dependencies with apt get run: | - sudo apt-get install -y libdbus-1-dev libdbus-glib-1-dev + sudo apt-get install -y libdbus-1-dev libdbus-glib-1-dev xvfb - name: Install Pipenv run: | diff --git a/README.md b/README.md index 89db00d..b4847db 100644 --- a/README.md +++ b/README.md @@ -61,4 +61,6 @@ Run the tests: In order to get test coverage, run the following command and then open `htmlcov/index.html` - coverage run -m unittest discover && coverage html \ No newline at end of file + coverage run -m unittest discover && coverage html + +test \ No newline at end of file diff --git a/test/test_UILayoutHelper.py b/test/test_UILayoutHelper.py index 96f84ad..ed4c5e6 100644 --- a/test/test_UILayoutHelper.py +++ b/test/test_UILayoutHelper.py @@ -1,3 +1,4 @@ +import os import unittest from unittest.mock import Mock, patch @@ -8,6 +9,10 @@ class TestUILayoutHelper(unittest.TestCase): def setUp(self): + if os.name != "nt" and os.getenv("GITHUB_ACTIONS"): + os.system('Xvfb :1 -screen 0 1600x1200x16 &') + os.environ["DISPLAY"] = ":1.0" + self.root = CTk() config_manager = Mock()