summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2023-01-27 20:01:48 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2023-01-27 20:08:31 +0000
commit6152280fcc209c37632e1e6d78f58b7c4c9fb4bb (patch)
treedc124bc8d18a7fba22aca9683e45b052c34deac3
parent0f8a2e5428ece351914d25b7fcd91da4ff6c0aa7 (diff)
downloadpygobject-6152280fcc209c37632e1e6d78f58b7c4c9fb4bb.tar.gz
CI: try to make the flatpak tests run again
Half a year ago they broke due to some changes of either the gnome-runtime-images docker images, or the contained flatpak, or something else: https://gitlab.gnome.org/GNOME/gnome-runtime-images/-/issues/7 This creates a fake dbus system bus so flatpak run doesn't fail. After this it turned out that pip install is now completely broken in the sdk and it installs packages to a place where it can't find them afterwards, so just use a venv instead. Finally the pygobject test suite still crashes at some point, but at least it's better then before.
-rw-r--r--.gitlab-ci.yml8
-rwxr-xr-x.gitlab-ci/test-flatpak-gtk4.sh6
-rwxr-xr-x.gitlab-ci/test-flatpak.sh9
3 files changed, 14 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 634a5f4c..0f9b48a8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -110,7 +110,9 @@ gnome-master:
tags:
- flatpak
script:
- - xvfb-run -a flatpak run --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//master -x .gitlab-ci/test-flatpak.sh
+ # https://gitlab.gnome.org/GNOME/gnome-runtime-images/-/issues/7
+ - export DBUS_SYSTEM_BUS_ADDRESS="$(dbus-daemon --session --print-address --fork)"
+ - xvfb-run -a flatpak run --user --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//master -x .gitlab-ci/test-flatpak.sh
gnome-master-gtk4:
allow_failure: true
@@ -119,7 +121,9 @@ gnome-master-gtk4:
tags:
- flatpak
script:
- - xvfb-run -a flatpak run --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//master -x .gitlab-ci/test-flatpak-gtk4.sh
+ # https://gitlab.gnome.org/GNOME/gnome-runtime-images/-/issues/7
+ - export DBUS_SYSTEM_BUS_ADDRESS="$(dbus-daemon --session --print-address --fork)"
+ - xvfb-run -a flatpak run --user --filesystem=host --share=network --socket=x11 --command=bash org.gnome.Sdk//master -x .gitlab-ci/test-flatpak-gtk4.sh
artifacts:
paths:
- coverage/
diff --git a/.gitlab-ci/test-flatpak-gtk4.sh b/.gitlab-ci/test-flatpak-gtk4.sh
index a299b641..2e775dab 100755
--- a/.gitlab-ci/test-flatpak-gtk4.sh
+++ b/.gitlab-ci/test-flatpak-gtk4.sh
@@ -8,8 +8,10 @@ export COVERAGE_FILE="${COV_DIR}/.coverage.${COV_KEY}"
mkdir -p "${COV_DIR}"
export TEST_GTK_VERSION=4.0
-python3 -m pip install --user pytest pytest-faulthandler coverage
+python3 -m venv _venv
+. _venv/bin/activate
+python3 -m pip install pytest pytest-faulthandler coverage
python3 setup.py build_tests
python3 -m coverage run --context "${COV_KEY}" tests/runtests.py
python3 -m coverage lcov -o "${COV_DIR}/${COV_KEY}.py.lcov"
-chmod -R 777 "${COV_DIR}" \ No newline at end of file
+chmod -R 777 "${COV_DIR}"
diff --git a/.gitlab-ci/test-flatpak.sh b/.gitlab-ci/test-flatpak.sh
index b76eefa6..57b7f926 100755
--- a/.gitlab-ci/test-flatpak.sh
+++ b/.gitlab-ci/test-flatpak.sh
@@ -2,8 +2,7 @@
set -e
-python3 -m pip install --user pytest pytest-faulthandler
-# for some reason pip3 fails the first time now..
-# https://gitlab.com/freedesktop-sdk/freedesktop-sdk/issues/776
-python3 -m pip install --user pytest pytest-faulthandler
-python3 setup.py test -s \ No newline at end of file
+python3 -m venv _venv
+. _venv/bin/activate
+python3 -m pip install pytest pytest-faulthandler
+python3 setup.py test -s