Skip to content

Commit 8648984

Browse files
committed
add GitHub Action to run tests
1 parent 0a52110 commit 8648984

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/python-app.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/test_text_comp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from avp.command import Command
2+
from PyQt6.QtGui import QFont
23
from pytestqt import qtbot
34
from pytest import fixture
45
from . import audioData, MockSignal, imageDataSum
@@ -18,6 +19,7 @@ def test_comp_text_renderFrame_resize(coreWithTextComp):
1819
comp.parent.settings.setValue("outputWidth", 1920)
1920
comp.parent.settings.setValue("outputHeight", 1080)
2021
comp.parent.core.updateComponent(0)
22+
comp.titleFont = QFont("Noto Sans")
2123
image = comp.frameRender(0)
2224
assert imageDataSum(image) == 2957069
2325

0 commit comments

Comments
 (0)