[tracker/sam/functional-tests-shared: 14/21] functional-tests: Add new trackertestutils module



commit 0d1a6149d30b960277c1cafae45762882fc56094
Author: Sam Thursfield <sam afuera me uk>
Date:   Wed Aug 7 14:47:00 2019 +0200

    functional-tests: Add new trackertestutils module
    
    This module aims to reduce duplication between tracker.git and
    tracker-miners.git. The idea is to share as much code as we can
    between the different functional-tests. The tracker-sandbox
    script will also be use this library.
    
    The module is installed into Tracker's private library directory.
    As it is only needed for development and testing, packagers should split
    it into the appropriate -devel package.

 tests/functional-tests/17-ontology-changes.py                        | 5 +++--
 tests/functional-tests/meson.build                                   | 3 +++
 utils/meson.build                                                    | 1 +
 .../common/utils => utils/trackertestutils}/dconf.py                 | 0
 4 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/tests/functional-tests/17-ontology-changes.py b/tests/functional-tests/17-ontology-changes.py
index 45817038c..0abf98e6e 100755
--- a/tests/functional-tests/17-ontology-changes.py
+++ b/tests/functional-tests/17-ontology-changes.py
@@ -32,9 +32,10 @@ import re
 import tempfile
 import time
 
+import trackertestutils.dconf
+
 from common.utils import configuration as cfg
 from common.utils import helpers
-from common.utils.dconf import DConfClient
 from common.utils.expectedFailure import expectedFailureJournal
 import unittest as ut
 
@@ -104,7 +105,7 @@ class TrackerSystemAbstraction (object):
 
     def _apply_settings(self, settings):
         for schema_name, contents in settings.items():
-            dconf = DConfClient(schema_name)
+            dconf = trackertestutils.dconf.DConfClient(schema_name)
             dconf.reset()
             for key, value in contents.items():
                 dconf.write(key, value)
diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build
index d74c0806f..793790230 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -42,6 +42,9 @@ test_env = environment()
 test_env.set('DCONF_PROFILE', dconf_profile_full_path)
 test_env.set('GSETTINGS_SCHEMA_DIR', tracker_uninstalled_gsettings_schema_dir)
 
+uninstalled_trackertestutils_dir = join_paths(meson.current_source_dir(), '..', '..', 'utils')
+test_env.prepend('PYTHONPATH', uninstalled_trackertestutils_dir)
+
 test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir)
 test_env.set('TRACKER_FUNCTIONAL_TEST_BUILD_DIR', build_root)
 test_env.set('TRACKER_FUNCTIONAL_TEST_CONFIG', config_json_full_path)
diff --git a/utils/meson.build b/utils/meson.build
index c624b4914..3b7847501 100644
--- a/utils/meson.build
+++ b/utils/meson.build
@@ -1,3 +1,4 @@
 subdir('mtp')
 subdir('ontology')
 subdir('tracker-resdump')
+subdir('trackertestutils')
diff --git a/tests/functional-tests/common/utils/dconf.py b/utils/trackertestutils/dconf.py
similarity index 100%
rename from tests/functional-tests/common/utils/dconf.py
rename to utils/trackertestutils/dconf.py


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