From c452f06446b2217b16c61cdd2043ede5588c1e8e Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 21 May 2020 23:40:33 +0200 Subject: [PATCH 1/3] functional-tests: Rename helper module This can be useful for testing other miners, not just minerfs. --- tests/functional-tests/fixtures.py | 2 +- tests/functional-tests/{minerfshelper.py => minerhelper.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/functional-tests/{minerfshelper.py => minerhelper.py} (100%) diff --git a/tests/functional-tests/fixtures.py b/tests/functional-tests/fixtures.py index 5acaeb6a7..26f131995 100644 --- a/tests/functional-tests/fixtures.py +++ b/tests/functional-tests/fixtures.py @@ -43,7 +43,7 @@ import unittest as ut import trackertestutils.dconf import trackertestutils.helpers import configuration as cfg -from minerfshelper import MinerFsHelper +from minerhelper import MinerFsHelper log = logging.getLogger(__name__) diff --git a/tests/functional-tests/minerfshelper.py b/tests/functional-tests/minerhelper.py similarity index 100% rename from tests/functional-tests/minerfshelper.py rename to tests/functional-tests/minerhelper.py -- GitLab From e2a239763910a61c9fca2b49282b8e79212a2db6 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 22 May 2020 20:59:04 +0200 Subject: [PATCH 2/3] functional-tests: Use dconf helper This depends on a small change in tracker.git added in https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/254 --- tests/functional-tests/fixtures.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/functional-tests/fixtures.py b/tests/functional-tests/fixtures.py index 26f131995..8b0fe892b 100644 --- a/tests/functional-tests/fixtures.py +++ b/tests/functional-tests/fixtures.py @@ -40,7 +40,6 @@ import sys import time import unittest as ut -import trackertestutils.dconf import trackertestutils.helpers import configuration as cfg from minerhelper import MinerFsHelper @@ -108,10 +107,7 @@ class TrackerMinerTest(ut.TestCase): # function. os.makedirs(self.indexed_dir, exist_ok=True) - for schema_name, contents in self.config().items(): - dconf = trackertestutils.dconf.DConfClient(self.sandbox) - for key, value in contents.items(): - dconf.write(schema_name, key, value) + self.sandbox.set_config(self.config()) self.miner_fs = MinerFsHelper(self.sandbox.get_connection()) self.miner_fs.start() -- GitLab From 2e13d8b302bca356c181fc876705456d6a1ca641 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Sat, 13 Jun 2020 20:23:05 +0200 Subject: [PATCH 3/3] functional-tests: Adapt for changed trackertestutils API --- tests/functional-tests/fixtures.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional-tests/fixtures.py b/tests/functional-tests/fixtures.py index 8b0fe892b..ac332fd56 100644 --- a/tests/functional-tests/fixtures.py +++ b/tests/functional-tests/fixtures.py @@ -96,7 +96,7 @@ class TrackerMinerTest(ut.TestCase): extra_env['LANG'] = 'en_GB.utf8' self.sandbox = trackertestutils.helpers.TrackerDBusSandbox( - dbus_daemon_config_file=cfg.TEST_DBUS_DAEMON_CONFIG_FILE, extra_env=extra_env) + session_bus_config_file=cfg.TEST_DBUS_DAEMON_CONFIG_FILE, extra_env=extra_env) self.sandbox.start() @@ -109,7 +109,7 @@ class TrackerMinerTest(ut.TestCase): self.sandbox.set_config(self.config()) - self.miner_fs = MinerFsHelper(self.sandbox.get_connection()) + self.miner_fs = MinerFsHelper(self.sandbox.get_session_bus_connection()) self.miner_fs.start() self.miner_fs.start_watching_progress() @@ -405,7 +405,7 @@ class TrackerWritebackTest (TrackerMinerTest): def setUp(self): super(TrackerWritebackTest, self).setUp() self.writeback_proxy = Gio.DBusProxy.new_sync( - self.sandbox.get_connection(), + self.sandbox.get_session_bus_connection(), Gio.DBusProxyFlags.DO_NOT_AUTO_START_AT_CONSTRUCTION, None, self.WRITEBACK_BUSNAME, self.WRITEBACK_PATH, self.WRITEBACK_IFACE) -- GitLab