summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2019-08-07 14:47:00 +0200
committerSam Thursfield <sam@afuera.me.uk>2019-08-23 12:39:19 +0300
commit8ae991922d4178f250cbc3e7f0734d558b01b21e (patch)
tree78fedc7017e0b7785cc340f33287a91451540b64
parente71c9119c34419a345ffbc80af40a6654a78af28 (diff)
downloadtracker-8ae991922d4178f250cbc3e7f0734d558b01b21e.tar.gz
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.
-rwxr-xr-xtests/functional-tests/17-ontology-changes.py5
-rw-r--r--tests/functional-tests/meson.build3
-rw-r--r--utils/meson.build1
-rw-r--r--utils/trackertestutils/README.md2
-rw-r--r--utils/trackertestutils/__init__.py1
-rw-r--r--utils/trackertestutils/dconf.py (renamed from tests/functional-tests/common/utils/dconf.py)0
-rw-r--r--utils/trackertestutils/meson.build7
7 files changed, 17 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 c482fc3df..be3fc2a4a 100644
--- a/tests/functional-tests/meson.build
+++ b/tests/functional-tests/meson.build
@@ -33,6 +33,9 @@ test_env = environment()
test_env.set('DCONF_PROFILE', dconf_profile_full_path)
test_env.set('GSETTINGS_SCHEMA_DIR', tracker_uninstalled_gsettings_schema_dir)
+tracker_uninstalled_testutils_dir = join_paths(meson.current_source_dir(), '..', '..', 'utils')
+test_env.prepend('PYTHONPATH', tracker_uninstalled_testutils_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/utils/trackertestutils/README.md b/utils/trackertestutils/README.md
new file mode 100644
index 000000000..98840ba0a
--- /dev/null
+++ b/utils/trackertestutils/README.md
@@ -0,0 +1,2 @@
+This Python package contains utility functions which are useful when testing
+Tracker.
diff --git a/utils/trackertestutils/__init__.py b/utils/trackertestutils/__init__.py
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/utils/trackertestutils/__init__.py
@@ -0,0 +1 @@
+
diff --git a/tests/functional-tests/common/utils/dconf.py b/utils/trackertestutils/dconf.py
index 328f9b845..328f9b845 100644
--- a/tests/functional-tests/common/utils/dconf.py
+++ b/utils/trackertestutils/dconf.py
diff --git a/utils/trackertestutils/meson.build b/utils/trackertestutils/meson.build
new file mode 100644
index 000000000..163aecfdf
--- /dev/null
+++ b/utils/trackertestutils/meson.build
@@ -0,0 +1,7 @@
+sources = [
+ '__init__.py',
+ 'dconf.py',
+]
+
+install_data(sources,
+ install_dir: join_paths(tracker_internal_libs_dir, 'trackertestutils'))