diff options
| author | Brianna Rainey | 2026-01-22 21:53:26 -0500 |
|---|---|---|
| committer | Brianna Rainey | 2026-01-22 21:53:26 -0500 |
| commit | 864898419e810055b51e3a32fccb00a62aab9a6b (patch) | |
| tree | 1eb6d03e3ef429e9d318bf0dff15c92c179421d0 | |
| parent | 0a521106c4f57a7a198e8238ad9bf6772c4e23b5 (diff) | |
add GitHub Action to run tests
| -rw-r--r-- | .github/workflows/python-app.yml | 40 | ||||
| -rw-r--r-- | tests/test_text_comp.py | 2 |
2 files changed, 42 insertions, 0 deletions
diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..fefb727 --- /dev/null +++ b/.github/workflows/python-app.yml | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | # This workflow will install Python dependencies and run tests with a single version of Python | ||
| 2 | # | ||
| 3 | # For more information see: | ||
| 4 | # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
| 5 | # | ||
| 6 | # For information on using pytest-qt in GitHub Actions see: | ||
| 7 | # https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd | ||
| 8 | |||
| 9 | name: Python application | ||
| 10 | |||
| 11 | on: | ||
| 12 | push: | ||
| 13 | branches: [ "master" ] | ||
| 14 | pull_request: | ||
| 15 | branches: [ "master" ] | ||
| 16 | |||
| 17 | permissions: | ||
| 18 | contents: read | ||
| 19 | |||
| 20 | jobs: | ||
| 21 | build: | ||
| 22 | |||
| 23 | runs-on: ubuntu-latest | ||
| 24 | env: | ||
| 25 | DISPLAY: ':99.0' | ||
| 26 | steps: | ||
| 27 | - uses: actions/checkout@v3 | ||
| 28 | - name: Set up Python 3.12 | ||
| 29 | uses: actions/setup-python@v3 | ||
| 30 | with: | ||
| 31 | python-version: "3.12" | ||
| 32 | - name: Install system dependencies | ||
| 33 | run: | | ||
| 34 | sudo apt install -y ffmpeg libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 x11-utils libgl1 libegl1 libdbus-1-3 libxcb-cursor0 fonts-noto-core | ||
| 35 | - name: Install Python dependencies | ||
| 36 | run: | | ||
| 37 | pip install . pytest pytest-qt pytest-xvfb | ||
| 38 | - name: Test with pytest | ||
| 39 | run: | | ||
| 40 | python3 -m pytest -v \ No newline at end of file | ||
diff --git a/tests/test_text_comp.py b/tests/test_text_comp.py index 3bc0be6..23dd1fd 100644 --- a/tests/test_text_comp.py +++ b/tests/test_text_comp.py | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | from avp.command import Command | 1 | from avp.command import Command |
| 2 | from PyQt6.QtGui import QFont | ||
| 2 | from pytestqt import qtbot | 3 | from pytestqt import qtbot |
| 3 | from pytest import fixture | 4 | from pytest import fixture |
| 4 | from . import audioData, MockSignal, imageDataSum | 5 | from . import audioData, MockSignal, imageDataSum |
| @@ -18,6 +19,7 @@ def test_comp_text_renderFrame_resize(coreWithTextComp): | |||
| 18 | comp.parent.settings.setValue("outputWidth", 1920) | 19 | comp.parent.settings.setValue("outputWidth", 1920) |
| 19 | comp.parent.settings.setValue("outputHeight", 1080) | 20 | comp.parent.settings.setValue("outputHeight", 1080) |
| 20 | comp.parent.core.updateComponent(0) | 21 | comp.parent.core.updateComponent(0) |
| 22 | comp.titleFont = QFont("Noto Sans") | ||
| 21 | image = comp.frameRender(0) | 23 | image = comp.frameRender(0) |
| 22 | assert imageDataSum(image) == 2957069 | 24 | assert imageDataSum(image) == 2957069 |
| 23 | 25 | ||
