[tracker/wip/carlosg/test] test



commit 945d427b1ddbf65d6ff2b10e1e499daeb5a7c8c4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Nov 5 16:40:33 2018 +0100

    test

 .gitlab-ci.yml                                    | 31 ++++++++++++-----------
 tests/libtracker-common/tracker-file-utils-test.c |  6 +++--
 2 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 75470763b..ffae9dfbb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,18 +1,19 @@
 stages:
   - test
 
-test-fedora-latest:
-  stage: test
-  image: registry.gitlab.gnome.org/sthursfield/tracker-oci-images/amd64/fedora:latest
-
-  script:
-    - su tracker -c 'mkdir build'
-    - su tracker -c 'cd build; meson ..'
-    - su tracker -c 'cd build; ninja'
-    - |
-      # Remove the many "CI_" variables from the environment. Meson dumps the
-      # whole environment for every failed test, and that gives a whole
-      # screenful of junk each time unless we strip these.
-      unset $(env|grep -o '^CI_[^=]*')
-
-      su tracker -c 'cd build; LANG=en_US.UTF8 dbus-launch meson test --print-errorlogs'
+fedora:rawhide:
+    image: fedora:rawhide
+    stage: test
+    before_script:
+        - dnf install -y 'dnf-command(builddep)' redhat-rpm-config meson ninja-build dbus-devel python2 
dbus-x11 gvfs pygobject3-devel tracker --nogpgcheck
+        - dnf builddep -y tracker --nogpgcheck
+    script:
+        - meson _build .
+        - cd _build
+        - |
+          # Remove the many "CI_" variables from the environment. Meson dumps the
+          # whole environment for every failed test, and that gives a whole
+          # screenful of junk each time unless we strip these.
+          unset $(env|grep -o '^CI_[^=]*')
+        - export LANG=en_US.UTF8
+        - dbus-launch meson test --print-errorlogs
diff --git a/tests/libtracker-common/tracker-file-utils-test.c 
b/tests/libtracker-common/tracker-file-utils-test.c
index d1ddf3004..d0c2120a1 100644
--- a/tests/libtracker-common/tracker-file-utils-test.c
+++ b/tests/libtracker-common/tracker-file-utils-test.c
@@ -134,7 +134,7 @@ test_path_evaluate_name (void)
        gchar *result, *expected;
 
        const gchar *home = g_getenv ("HOME");
-       const gchar *pwd = g_getenv ("PWD");
+       const gchar *pwd = g_get_tmp_dir ();
 
        const gchar *test = "/one/two";
        gchar *parent_dir;
@@ -318,7 +318,7 @@ test_file_utils_get_mtime ()
         // This comparison could lead a problem in 32/64 bits?
         g_assert_cmpint (mtime, ==, st.st_mtime);
 
-        pwd = g_get_current_dir ();
+        pwd = g_get_tmp_dir ();
         uri = g_strdup_printf ("file://%s/%s", pwd, TEST_FILENAME);
         mtime = tracker_file_get_mtime_uri (uri);
         // This comparison could lead a problem in 32/64 bits?
@@ -434,6 +434,8 @@ main (int argc, char **argv)
 
        setlocale (LC_ALL, "");
 
+       chdir (g_get_tmp_dir ());
+
         ensure_file_exists (TEST_FILENAME);
         ensure_file_exists (TEST_HIDDEN_FILENAME);
 


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