[gobject-introspection/ci-test-py35] ci: test with Python 3.5 and fix tests



commit 14910b760f4b308082cd4a2297c815107b9e1e3d
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Fri Mar 15 12:18:54 2019 +0100

    ci: test with Python 3.5 and fix tests

 .gitlab-ci.yml                  | 24 +++++++++++++++++++++++-
 .gitlab-ci/Dockerfile           | 17 ++++++++++++-----
 .gitlab-ci/run-docker.sh        |  2 +-
 tests/scanner/test_ccompiler.py |  4 ++--
 4 files changed, 38 insertions(+), 9 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f01e759e..72d6f7a1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,7 +2,7 @@ stages:
   - build
   - deploy
 
-image: registry.gitlab.gnome.org/gnome/gobject-introspection:v4
+image: registry.gitlab.gnome.org/gnome/gobject-introspection:v5
 
 cache:
   paths:
@@ -15,6 +15,7 @@ fedora-x86_64-meson:
     CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache"
     CFLAGS: "-Werror"
   script:
+    - python3 -m pip install --user mako markdown
     - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=true -Dgtk_doc=true -Dcairo=true 
-Dpython=python3 _build .
     - cd _build
     - ninja
@@ -34,6 +35,27 @@ fedora-x86_64-meson:
       - "${CI_PROJECT_DIR}/_build/meson-logs"
       - public
 
+fedora-x86_64-python3.5:
+  stage: build
+  variables:
+    CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
+    CCACHE_DIR: "${CI_PROJECT_DIR}/_ccache"
+    PYENV_VERSION: "3.5.6"
+  script:
+    - python3 -m pip install --user mako markdown
+    - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=true -Dgtk_doc=true -Dcairo=true 
-Dpython=python3 _build .
+    - cd _build
+    - ninja
+    - meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
+  except:
+    - tags
+  artifacts:
+    when: always
+    name: "gi-_${CI_COMMIT_REF_NAME}"
+    paths:
+      - "${CI_PROJECT_DIR}/_build/meson-logs"
+      - public
+
 msys2-mingw32-meson:
   stage: build
   tags:
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
index 0330e3af..dd7a0ccc 100644
--- a/.gitlab-ci/Dockerfile
+++ b/.gitlab-ci/Dockerfile
@@ -23,26 +23,27 @@ RUN dnf -y install \
     glibc-headers \
     gtk-doc \
     itstool \
-    libtool \
-    libXft-devel \
-    libXfixes-devel \
     libattr-devel \
     libffi-devel \
     libmount-devel \
     libselinux-devel \
+    libtool \
+    libXfixes-devel \
+    libXft-devel \
     libxml2-devel \
     libxslt \
     make \
     mesa-libGL-devel \
     ninja-build \
+    openssl-devel \
     pcre-devel \
     python3 \
     python3-devel \
-    python3-mako \
-    python3-markdown \
     python3-pip \
     python3-wheel \
+    readline-devel \
     redhat-rpm-config \
+    sqlite-devel \
     systemtap-sdt-devel \
     zlib-devel \
  && dnf clean all
@@ -57,3 +58,9 @@ USER user
 WORKDIR /home/user
 
 ENV LANG C.UTF-8
+
+ENV PYENV_ROOT /home/user/.pyenv
+ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
+ENV PYTHON_CONFIGURE_OPTS="--enable-shared"
+RUN curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
+RUN pyenv install 3.5.6
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh
index ef014646..2334edad 100755
--- a/.gitlab-ci/run-docker.sh
+++ b/.gitlab-ci/run-docker.sh
@@ -2,7 +2,7 @@
 
 set -e
 
-TAG="registry.gitlab.gnome.org/gnome/gobject-introspection:v4"
+TAG="registry.gitlab.gnome.org/gnome/gobject-introspection:v5"
 
 sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
     --file "Dockerfile" .
diff --git a/tests/scanner/test_ccompiler.py b/tests/scanner/test_ccompiler.py
index dd8700d8..b15b3144 100644
--- a/tests/scanner/test_ccompiler.py
+++ b/tests/scanner/test_ccompiler.py
@@ -85,7 +85,7 @@ class UnixCCompilerTest(unittest.TestCase):
                 # Don't actually do anything.
                 cc.compiler.dry_run = True
                 cc.compile(pkg_config_cflags, cpp_includes, [source], init_sections)
-        spawn.assert_called_once()
+        self.assertEqual(spawn.call_count, 1)
         args, kwargs = spawn.call_args
         return args[0]
 
@@ -106,7 +106,7 @@ class UnixCCompilerTest(unittest.TestCase):
                 # Don't actually do anything.
                 cc.compiler.dry_run = True
                 cc.preprocess(source, output, cpp_options)
-        spawn.assert_called_once()
+        self.assertEqual(spawn.call_count, 1)
         args, kwargs = spawn.call_args
         return args[0]
 


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