diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-11-01 18:05:50 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-12-18 18:40:33 +0000 |
commit | d8cddb51fc8b4c341bb928674034b47fe1c0e723 (patch) | |
tree | 37cf81b52d6051a365dd13ee8f37538036ef35b0 /tests/functional-tests/common/utils/helpers.py | |
parent | 7036a21d7dea0b5e53c6b751b5472d9f72082645 (diff) | |
download | tracker-d8cddb51fc8b4c341bb928674034b47fe1c0e723.tar.gz |
functional-tests: Fix configuration to work with Mesonwip/sam/meson-functional-tests
Previously the functional-test suite would test the installed version of
Tracker, but would need to be run from a configured Tracker source+build tree.
I have changed how things are configured and now with Meson the functional tests
can be run completely from the build tree, without needing to install
anything. The Autotools `make functional-test` target works the same as
before.
Instead of generating a Python source file that contains the build-time
configuration, we write that to a .json file which is read when the
common.utils.configuration module is imported. This controls the
locations of the various things that the tests require, which allows us
to support any kind fo build tree layout.
With the new setup it should also be possible to add a target that
explicitly installs the functional tests, with a different
configuration.json file such that they test the installed version of
Tracker. That's not yet implemented.
Diffstat (limited to 'tests/functional-tests/common/utils/helpers.py')
-rw-r--r-- | tests/functional-tests/common/utils/helpers.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py index d085e2697..95e48401b 100644 --- a/tests/functional-tests/common/utils/helpers.py +++ b/tests/functional-tests/common/utils/helpers.py @@ -78,9 +78,7 @@ class Helper: sys.excepthook = new_hook def _start_process (self): - path = getattr (self, - "PROCESS_PATH", - os.path.join (cfg.EXEC_PREFIX, self.PROCESS_NAME)) + path = self.PROCESS_PATH flags = getattr (self, "FLAGS", []) @@ -93,7 +91,10 @@ class Helper: command = [path] + flags log ("Starting %s" % ' '.join(command)) - return subprocess.Popen ([path] + flags, **kws) + try: + return subprocess.Popen ([path] + flags, **kws) + except OSError as e: + raise RuntimeError("Error starting %s: %s" % (path, e)) def _bus_name_appeared(self, name, owner, data): log ("[%s] appeared in the bus as %s" % (self.PROCESS_NAME, owner)) @@ -212,6 +213,7 @@ class StoreHelper (Helper): """ PROCESS_NAME = "tracker-store" + PROCESS_PATH = cfg.TRACKER_STORE_PATH BUS_NAME = cfg.TRACKER_BUSNAME graph_updated_handler_id = 0 @@ -469,6 +471,9 @@ class StoreHelper (Helper): def update (self, update_sparql, timeout=5000, **kwargs): return self.resources.SparqlUpdate ('(s)', update_sparql, timeout=timeout, **kwargs) + def load (self, ttl_uri, timeout=5000, **kwargs): + return self.resources.Load ('(s)', ttl_uri, timeout=timeout, **kwargs) + def batch_update (self, update_sparql, **kwargs): return self.resources.BatchSparqlUpdate ('(s)', update_sparql, **kwargs) |