From 8445fd2f74d75ff2b5dd1181e0632093c174cb0c Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Thu, 28 Dec 2023 22:57:39 +0900 Subject: [PATCH 1/2] Fix test_MainWindow_annotate_jpg --- tests/labelme_tests/test_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/labelme_tests/test_app.py b/tests/labelme_tests/test_app.py index 2cf99c7f1..5e1455bba 100644 --- a/tests/labelme_tests/test_app.py +++ b/tests/labelme_tests/test_app.py @@ -101,6 +101,7 @@ def test_MainWindow_annotate_jpg(qtbot): group_id=None, points=points, shape_type="polygon", + mask=None, flags={}, other_data={}, ) From 4bb932933b75e087a31f343dbf91ff176f22c8ed Mon Sep 17 00:00:00 2001 From: Kentaro Wada Date: Thu, 28 Dec 2023 23:06:26 +0900 Subject: [PATCH 2/2] Use Xvfb to run tests only on ubuntu-latest libqt5widgets5 is required to run tests on ubuntu-latest --- .github/workflows/ci.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26dd8dbfb..368092d1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,20 +75,18 @@ jobs: - name: Test with pytest shell: bash -l {0} - if: matrix.os != 'windows-latest' && !(matrix.os == 'macos-latest' && matrix.PYTEST_QT_API == 'pyside2') + if: matrix.os == 'ubuntu-latest' env: PYTEST_QT_API: ${{ matrix.PYTEST_QT_API }} MPLBACKEND: 'agg' run: | - # # open virtual display - # if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then - # export DISPLAY=:99.0 - # /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset - # (herbstluftwm )& - # else - # (sudo Xvfb :99 -ac -screen 0 1024x768x8 )& - # fi - pytest -vs -m 'not gui' tests/ + sudo apt-get update + sudo apt-get install -y xvfb libqt5widgets5 + + Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & + export DISPLAY=:99 + + pytest tests - name: Run examples shell: bash -l {0}