diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-05-15 09:44:24 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-05-15 14:11:53 -0400 |
commit | 31cf894092f9f7c9ff1be2514ac4b4e8027d1a77 (patch) | |
tree | b793386a3f5a9bed828838f108dd729f37f647a7 | |
parent | 509db01319ff6b289e3171c8b67c07c2651a1a33 (diff) | |
download | gtk+-31cf894092f9f7c9ff1be2514ac4b4e8027d1a77.tar.gz |
ci: Run tests with different backends
Run the testsuite under x11, wayland and broadway
in the fedora-x86_64 job. This requires us to use
the v17 image which includes weston.
-rw-r--r-- | .gitlab-ci.yml | 34 | ||||
-rwxr-xr-x | .gitlab-ci/run-tests.sh | 61 |
2 files changed, 69 insertions, 26 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b228e9c657..84a9e0ddca 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ style-check-diff: - .gitlab-ci/run-style-check-diff.sh fedora-x86_64: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v17 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" @@ -47,20 +47,24 @@ fedora-x86_64: -Dprofiler=true _build - ninja -C _build - - .gitlab-ci/run-tests.sh _build + - .gitlab-ci/run-tests.sh _build x11 + - .gitlab-ci/run-tests.sh _build wayland + - .gitlab-ci/run-tests.sh _build broadway artifacts: when: always reports: junit: - - "${CI_PROJECT_DIR}/_build/report.xml" + - "${CI_PROJECT_DIR}/_build/report-x11.xml" + - "${CI_PROJECT_DIR}/_build/report-wayland.xml" + - "${CI_PROJECT_DIR}/_build/report-broadway.xml" name: "gtk-${CI_COMMIT_REF_NAME}" paths: - "${CI_PROJECT_DIR}/_build/meson-logs" - - "${CI_PROJECT_DIR}/_build/report.xml" - - "${CI_PROJECT_DIR}/_build/report.html" - - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png" - - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png" - - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap" + - "${CI_PROJECT_DIR}/_build/report*.xml" + - "${CI_PROJECT_DIR}/_build/report*.html" + - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap" cache: key: "$CI_JOB_NAME" <<: *cache-paths @@ -78,20 +82,20 @@ release-build: -Dvulkan=yes _build - ninja -C _build - - .gitlab-ci/run-tests.sh _build + - .gitlab-ci/run-tests.sh _build x11 artifacts: when: always reports: junit: - - "${CI_PROJECT_DIR}/_build/report.xml" + - "${CI_PROJECT_DIR}/_build/report-x11.xml" name: "gtk-${CI_COMMIT_REF_NAME}" paths: - "${CI_PROJECT_DIR}/_build/meson-logs" - - "${CI_PROJECT_DIR}/_build/report.xml" - - "${CI_PROJECT_DIR}/_build/report.html" - - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png" - - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png" - - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap" + - "${CI_PROJECT_DIR}/_build/report*.xml" + - "${CI_PROJECT_DIR}/_build/report*.html" + - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap" cache: key: "$CI_JOB_NAME" <<: *cache-paths diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh index 5638fa6593..5f402f306e 100755 --- a/.gitlab-ci/run-tests.sh +++ b/.gitlab-ci/run-tests.sh @@ -5,30 +5,69 @@ set +e srcdir=$( pwd ) builddir=$1 +backend=$2 -export GDK_BACKEND=x11 -xvfb-run -a -s "-screen 0 1024x768x24" \ - meson test -C ${builddir} \ +case "${backend}" in + x11) + xvfb-run -a -s "-screen 0 1024x768x24" \ + meson test -C ${builddir} \ --print-errorlogs \ + --setup=${backend} \ --suite=gtk \ --no-suite=gtk:a11y -# Store the exit code for the CI run, but always -# generate the reports -exit_code=$? + # Store the exit code for the CI run, but always + # generate the reports + exit_code=$? + ;; + + wayland) + export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" + + weston --backend=headless-backend.so --socket=wayland-5 & + compositor=$! + export WAYLAND_DISPLAY=wayland-5 + + meson test -C ${builddir} \ + --print-errorlogs \ + --setup=${backend} \ + --suite=gtk \ + --no-suite=gtk:a11y + + exit_code=$? + kill ${compositor} + ;; + + broadway) + export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" + + ${builddir}/gdk/broadway/gtk4-broadwayd :5 & + server=$! + export BROADWAY_DISPLAY=:5 + + meson test -C ${builddir} \ + --print-errorlogs \ + --setup=${backend} \ + --suite=gtk \ + --no-suite=gtk:a11y + + exit_code=$? + kill ${server} + ;; +esac cd ${builddir} $srcdir/.gitlab-ci/meson-junit-report.py \ --project-name=gtk \ --job-id="${CI_JOB_NAME}" \ - --output=report.xml \ - meson-logs/testlog.json + --output=report-${backend}.xml \ + meson-logs/testlog-${backend}.json $srcdir/.gitlab-ci/meson-html-report.py \ --project-name=gtk \ --job-id="${CI_JOB_NAME}" \ - --reftest-output-dir="testsuite/reftests/output" \ - --output=report.html \ - meson-logs/testlog.json + --reftest-output-dir="testsuite/reftests/output/${backend}" \ + --output=report-${backend}.html \ + meson-logs/testlog-${backend}.json exit $exit_code |