From 340f2881d0239f52be09ac0c58ee3206335087ff Mon Sep 17 00:00:00 2001 From: magdev Date: Sun, 3 May 2026 21:13:35 +0200 Subject: [PATCH] ci: run qmltestrunner with offscreen Qt platform Headless CI runner has no X display, so qmltest aborts loading the xcb plugin. Set QT_QPA_PLATFORM=offscreen for the ctest invocation in CI and in both Makefile qmltest targets so local headless runs work too. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitea/workflows/ci.yml | 2 ++ examples/todo/Makefile | 2 +- framework/skeleton/Makefile | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 41adee1..5804346 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -79,6 +79,8 @@ jobs: - name: QML unit tests (qmltestrunner via Qt::QuickTest) working-directory: framework/qml + env: + QT_QPA_PLATFORM: offscreen run: | cmake -S . -B build-tests -DBUILD_TESTING=ON cmake --build build-tests --target qml_unit_tests --parallel diff --git a/examples/todo/Makefile b/examples/todo/Makefile index 6bae3e2..fefe9ee 100644 --- a/examples/todo/Makefile +++ b/examples/todo/Makefile @@ -93,4 +93,4 @@ quality: build qmltest ## Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint, q qmltest: ## Run QML unit tests (Qt::QuickTest via qmltestrunner) cmake -S ../../framework/qml -B ../../framework/qml/build-tests -DBUILD_TESTING=ON cmake --build ../../framework/qml/build-tests --target qml_unit_tests --parallel - ctest --test-dir ../../framework/qml/build-tests --output-on-failure -R qml_unit_tests + QT_QPA_PLATFORM=offscreen ctest --test-dir ../../framework/qml/build-tests --output-on-failure -R qml_unit_tests diff --git a/framework/skeleton/Makefile b/framework/skeleton/Makefile index c4b6d43..9235bb7 100644 --- a/framework/skeleton/Makefile +++ b/framework/skeleton/Makefile @@ -87,4 +87,4 @@ quality: build qmltest ## Run PHPStan, php-cs-fixer (check), PHPUnit, qmllint, q qmltest: ## Run QML unit tests (Qt::QuickTest via qmltestrunner) cmake -S ../qml -B ../qml/build-tests -DBUILD_TESTING=ON cmake --build ../qml/build-tests --target qml_unit_tests --parallel - ctest --test-dir ../qml/build-tests --output-on-failure -R qml_unit_tests + QT_QPA_PLATFORM=offscreen ctest --test-dir ../qml/build-tests --output-on-failure -R qml_unit_tests