[tracker/wip/sam/test-sqlite: 44/44] ci: Add sqlite-compatibility job




commit 1662c6d8e381ccdcc021949ef9566bbd2955befc
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Mon Jul 19 13:30:40 2021 +0200

    ci: Add sqlite-compatibility job

 .gitlab-ci.yml                             | 25 +++++++++++++++++++++++
 utils/sqlite/fetch_build_install_sqlite.sh | 32 ++++++++++++++++++++++++++++++
 2 files changed, 57 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2bfc455a9..4fd19c6da 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -316,6 +316,7 @@ test-alpine@x86_64:
     - build-alpine-edge@x86_64
   <<: *test
 
+
 coverage-analysis:
   extends:
     - .fdo.distribution-image@fedora
@@ -400,3 +401,27 @@ pages:
   only:
     - master
     - /^sam\/website.*$/
+
+sqlite-compatibility:
+  stage: weekly-tasks
+  cache: { key: $CI_JOB_NAME, paths: [ ./sqlite-downloads/ ] }
+  script:
+    - |
+      mkdir -p sqlite-downloads
+      for version in $(grep -v '^#' ./sqlite3_versions_tested); do
+        echo "Installing SQLite ${version} into /usr"    # This is a CI container so we can break it :)
+        mkdir ./sqlite-build
+        bash ./utils/sqlite/fetch_build_install_sqlite.sh $version ./sqlite-downloads ./sqlite-builds /usr
+        echo "Building Tracker SPARQL against SQLite ${version}"
+        rm -Rf ./build; meson . build -Db_lto=true -Db_coverage=true -Dsystemd_user_services=false 
-Dtests_tap_protocol=true --prefix /usr
+        ninja -C build
+        echo "Running Tracker SPARQL test suite"
+        (cd build; env LANG=C.UTF-8 LC_ALL=C.UTF-8 dbus-run-session meson test --print-errorlogs 
${MESON_TEST_EXTRA_ARGS} )
+        echo "Cleaning up"
+        rm -Rf ./sqlite-build ./build
+      done
+  extends:
+    - .fdo.distribution-image@ubuntu
+    - .tracker.ubuntu:rolling@x86_64
+  needs:
+    - build-ubuntu-container@x86_64
diff --git a/utils/sqlite/fetch_build_install_sqlite.sh b/utils/sqlite/fetch_build_install_sqlite.sh
new file mode 100644
index 000000000..28b6d200e
--- /dev/null
+++ b/utils/sqlite/fetch_build_install_sqlite.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+# Fetch, build SQLite from source and install it into given prefix.
+#
+# Used for sqlite-compatibility CI job.
+
+set -eu
+
+RELEASE=$1
+DOWNLOAD_PATH=$(readlink -f $2)
+BUILD_PATH=$(readlink -f $3)
+PREFIX=$4
+
+tag=version-${RELEASE}
+filename=sqlite-${RELEASE}.tar.gz
+
+(
+  cd $DOWNLOAD_PATH
+  echo "Download $filename"
+  wget "https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=${tag}"; --continue -O $filename
+)
+
+(
+  cd $BUILD_PATH
+  echo "Extract $filename"
+  tar xf $DOWNLOAD_PATH/$filename
+
+  cd sqlite
+  ./configure --prefix=$PREFIX
+  make -j
+  make install
+)


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