[nautilus/csoriano-generate-coverage-patch-22550] CI: Generate coverage



commit f0dda1f7ffa485cee08060d7e9aacc3fe9f5aec4
Author: Carlos Soriano <csoriano1618 gmail com>
Date:   Tue Oct 9 13:47:32 2018 +0000

    CI: Generate coverage
    
    And show it in GitLab Pages. This will help us to keep an eye on the
    status of testing. The report can still be improved though.

 .gitlab-ci.yml | 59 ++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 37 insertions(+), 22 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 878db320b..b5c79aac3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -34,10 +34,31 @@ stages:
                   dbus-run-session meson test -C _build
         # Generate a Flatpak bundle
         - flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${DBUS_ID}
+        # Generate coverage report
+        - cd _build
+        - flatpak build ../app gcovr
+            --html-details
+            -o coverage.html
+            --print-summary
+            --root=.
+            --exclude=src/
+            --exclude=../data/
+            --exclude=../eel/check-program.c
+            --exclude=../eel/eel-debug.c
+            --exclude=../eel/eel-lib-self-check-functions.c
+            --exclude=../eel/eel-self-checks.c
+            --exclude=../src/animation/
+            --exclude=../src/gtk/
+            --exclude=../src/nautilus-lib-self-check-functions.c
+            --exclude=../src/nautilus-self-check-functions.c
+            --exclude=../subprojects/libgd/
+            --exclude=../test/
+    coverage: '/^branches:.*\s+(\S+\%).*$/'
     artifacts:
         paths:
             - ${BUNDLE}
             - _build/meson-logs/
+            - _build/coverage.html
         # The Flatpak bundle is always generated at the end, meaning that there
         # won’t be one in case of failure, but the logs will be available for
         # our expert investigators to dissect.
@@ -49,7 +70,7 @@ flatpak devel:
     stage: test
     variables:
         MANIFEST_PATH: "build-aux/flatpak/org.gnome.Nautilus.yml"
-        MESON_ARGS: "-Dprofile=Devel -Dtests=all"
+        MESON_ARGS: "-Dprofile=Devel -Dtests=all -Db_coverage=true"
         FLATPAK_MODULE: "nautilus"
         RUNTIME_REPO: "https://sdk.gnome.org/gnome.flatpakrepo";
         DBUS_ID: "org.gnome.NautilusDevel"
@@ -92,25 +113,7 @@ fedora rawhide:
         - dnf update -y --nogpgcheck
         - dnf install -y 'dnf-command(builddep)' redhat-rpm-config libseccomp-devel gcovr --nogpgcheck
         - dnf builddep -y nautilus --nogpgcheck
-    script:
-        - meson _build . -Db_coverage=true
-        - cd _build
-        - ninja test
-        - gcovr --root=.
-            --exclude=src/
-            --exclude=../data/
-            --exclude=../eel/check-program.c
-            --exclude=../eel/eel-debug.c
-            --exclude=../eel/eel-lib-self-check-functions.c
-            --exclude=../eel/eel-self-checks.c
-            --exclude=../src/animation/
-            --exclude=../src/gtk/
-            --exclude=../src/nautilus-lib-self-check-functions.c
-            --exclude=../src/nautilus-self-check-functions.c
-            --exclude=../subprojects/libgd/
-            --exclude=../test/
-    coverage: '/^TOTAL.*\s+(\d+\%)$/'
-
+    <<: *distro_test
     only:
         - schedules
         - web
@@ -180,7 +183,7 @@ flatpak master:
     stage: cross_environment
     variables:
         MANIFEST_PATH: "build-aux/flatpak/org.gnome.NautilusMaster.yml"
-        MESON_ARGS: "-Dprofile=Master -Dtests=all"
+        MESON_ARGS: "-Dprofile=Master -Dtests=all -Db_coverage=true"
         FLATPAK_MODULE: "nautilus"
         RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo";
         DBUS_ID: "org.gnome.NautilusMaster"
@@ -195,7 +198,7 @@ flatpak gtk4:
     stage: cross_environment
     variables:
         MANIFEST_PATH: "build-aux/flatpak/org.gnome.NautilusGtk4.yml"
-        MESON_ARGS: "-Dprofile=Gtk4 -Dtests=all"
+        MESON_ARGS: "-Dprofile=Gtk4 -Dtests=all -Db_coverage=true"
         FLATPAK_MODULE: "nautilus"
         RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo";
         DBUS_ID: "org.gnome.NautilusGtk4"
@@ -204,3 +207,15 @@ flatpak gtk4:
         - schedules
         - web
         - tags
+
+pages:
+  stage: deploy
+  script:
+    - mkdir public
+    - cd nautilus
+    - mv _build/coverage.html ${CI_PROJECT_DIR}/public/coverage/index.html
+  artifacts:
+    paths:
+      - public
+  only:
+    - master


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]