summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* | Update ontology URLs for 3.0Sam Thursfield2020-04-228-69/+69
|/ | | | | | | | | | | | | | | Our ontology URLs now use a namespace that we manage, at http://tracker.api.gnome.org/. This domain won't expire and can redirect anywhere we want, so that it can always link to the correct documentation for the ontologies. We are going to continue using the Nepomuk name in the ontologies that were developed by the Nepomuk project, despite changing the URL. This way we acknowledge that we have downstream changes to the Nepomuk ontologies but still provide a link to the original shared vocabularies. Fixes https://gitlab.gnome.org/GNOME/tracker/-/issues/162 and https://gitlab.gnome.org/GNOME/tracker/-/issues/104
* utils: Update references to tracker miners' DBus namesCarlos Garnacho2020-04-055-7/+7
| | | | It's bumping to org.freedesktop.Tracker3.*
* Merge branch 'sam/test-utils' into 'master'Sam Thursfield2020-04-042-4/+17
|\ | | | | | | | | Functional test improvements See merge request GNOME/tracker!207
| * trackertestutils: Add some utils needed in tracker-miner testssam/test-utilsSam Thursfield2020-03-232-4/+17
| |
* | Merge branch 'sam/remove-maemo' into 'master'Sam Thursfield2020-03-313-213/+0
|\ \ | |/ |/| | | | | Remove maemo ontology and tracker:defaultValue setting See merge request GNOME/tracker!194
| * Remove Maemo ontologySam Thursfield2020-03-063-213/+0
| | | | | | | | It's very obsolete.
* | Merge branch 'sam/sandbox-improvements' into 'master'Sam Thursfield2020-03-151-71/+30
|\ \ | | | | | | | | | | | | Some improvements for tracker-sandbox / run-uninstalled script See merge request GNOME/tracker!197
| * | trackertestutils: Fix crash on SIGINTSam Thursfield2020-03-091-3/+11
| | | | | | | | | | | | | | | | | | This code never executed because the sandbox would probably have already crashed due to the D-Bus daemon exiting before we wanted it to.
| * | trackertestutils: Always start D-Bus daemon in a new sessionSam Thursfield2020-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This means that if the user presses CTRL+C, the sandbox process will handle it and will shut down processes cleanly, but the D-Bus daemon will not receive the CTRL+C and will keep running until the sandbox process tells it to stop. This prevents errors during shutdown of Tracker processes which don't expect the message bus to have already disappeared.
| * | trackertestutils: Don't index applications by defaultSam Thursfield2020-03-091-3/+8
| | | | | | | | | | | | | | | | | | This means that Tracker instances created for testing and development will begin empty, and will only contain content explicitly added by the developer.
| * | trackertestutils: Use DConf instead of config filesSam Thursfield2020-03-091-64/+10
| |/ | | | | | | | | The DConf settings will be stored inside the sandbox directory inside the `config/dconf` subdirectory.
* | libtracker-data: Rewrite TrackerTurtleReader to reuse parser grammarCarlos Garnacho2020-03-102-15/+20
|/ | | | | | | | | | | | | | | | | Instead of tapping on the old TrackerSparqlScanner, use the grammar definitions from the new parser. Also rewrite it in C. This allows us to drop a whole bunch of the older parser code, which only stood there to parse TTL files efficiently. The new SPARQL parser code is designed to generate an intermediate expression tree, which is great to increase liberty at the time of interpreting it, but not so great at the time of deserializing randomly sized blobs of TTL data. Even though this new TTL parser doesn't 100% use the infrastructure of the new SPARQL parser, it taps on it for the essentials (parsing the subject/predicate/object terminals), and also allows incremental TTL loading without memory peaks. The advantages of the old TTL parser (and the only reason why it stuck) are now moot.
* functional-tests: Improve errors when awaiting resourcesSam Thursfield2020-02-171-3/+7
|
* Update functional tests for Tracker 3.0 changesSam Thursfield2020-02-172-291/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit updates the functional tests in line with the Tracker 3.0 architectural changes. These tests used to spawn a private tracker-store daemon and communicate over D-Bus. Most of the tests now create a local database in-process and run tests against that, using the PyGObject bindings to drive libtracker-sparql. It's good to test our Python bindings in this way. Some tests also test connecting to a database over D-Bus. The 'fixtures' module makes it easy to do either of these things. The 08-unique-insertions test is gone, it claimed that "we can't test tracker-miner-fs itself", but we can. The 14-signals test is now a test of the TrackerNotifier API. The 15-statistics test is removed as the API that it tests is gone. Numbers were removed from the filenames of all tests. It's debatable if the name "functional tests" really applies here any more, perhaps a bigger distinction from the "unit tests" which also run against libtracker-sparql is that these are written using Python and PyGObject instead of C. In tracker-miners.git we will still be testing multiple processes so the name will still make sense there.
* build: Drop g-ir-merge utilCarlos Garnacho2020-02-171-172/+0
| | | | | We no longer need to merge C/Vala gir files, thus we no longer need this script.
* libtracker-sparql: Allow specifying object path on DBus SPARQL connectionsCarlos Garnacho2020-02-172-2/+2
| | | | | | This may be useful for endpoints eg. implemented via application plugins, as a single dbus path can't be relied otherwise. We still look up for the /org/freedesktop/Tracker1/Endpoint object path by default.
* utils: Update utilities to use explicit bus connectionCarlos Garnacho2020-02-173-3/+4
| | | | Those will want to connect to the tracker-miner-fs endpoint.
* utils: Fix GraphUpdated checks in trackertestutilsCarlos Garnacho2019-12-071-4/+6
| | | | | | | | We should check whether there was a match before handling the delete events, as its handling might overwrite the match. Also, this function should unset its transient data on exit, not just on timeout.
* Merge branch 'sam/sandbox-disable-fuse' into 'master'Sam Thursfield2019-10-021-0/+8
|\ | | | | | | | | trackertestutils: Set GVFS_DISABLE_FUSE in the sandbox See merge request GNOME/tracker!148
| * trackertestutils: Set GVFS_DISABLE_FUSE in the sandboxSam Thursfield2019-09-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This avoids an issue I experience sometimes when using the `run-uninstalled` script. Since Tracker uses Gio APIs it causes gvfsd to start on the private message bus, and this by default starts gvfsd-fuse. However if the message bus shuts down while gvfsd-fuse is starting, the gvfsd-fuse process doesn't quit and instead stays around preventing the message bus from closing. I did try to fix the issue in gvfsd-fuse. However the code has changed recently so perhaps the issue is already fixed in 1.42.0.
* | Merge branch 'sam/tracker-sandbox-shared' into 'master'Sam Thursfield2019-10-024-6/+31
|\ \ | | | | | | | | | | | | Make trackertestutils easier for other projects to use See merge request GNOME/tracker!147
| * | utils/trackertestutils: Make it usable by other projectsSam Thursfield2019-09-282-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes the tracker-testutils-2.0 package more reusable. The idea is that projects using Tracker can use this as a way to sandbox their test suites from the user's real Tracker data. In your meson.build file you would do something like this to locate the script and run your test. python3 = find_program('python3') trackertestutils = dependency('tracker-testutils-2.0') tracker_sandbox_command = find_program(trackertestutils.get_pkgconfig_variable('command')) test('myapptest', tracker_sandbox_command, args: ['--index-tmpdir', my_app_test_executable]) This would ensure that XDG_CACHE_HOME and XDG_DATA_HOME point to a temporary directory, separate from any real Tracker index data that the current user might have inside their XDG cache & data directories.
| * | utils/trackertestutils: Give better error if dbus-daemon can't be foundSam Thursfield2019-09-281-1/+10
| | | | | | | | | | | | | | | We also now use `shutil.which()` to find the binary. This shouldn't change anything as we were already looking in PATH for the binary.
| * | utils/trackertestutils: Fix broken PATH and LD_LIBRARY_PATHSam Thursfield2019-09-281-2/+2
| |/ | | | | | | | | This fixes a regression from b68cef0297254aac79c which caused us to remove the existing PATH when --prefix was used.
* | meson: Use pkgconfig module to generate filesMarco Trevisan (Treviño)2019-10-011-2/+0
|/ | | | | | | | Meson provides a pkgconfig module to generate .pc files without any need to defile stub files, but reusing libraries. So just use this convenience feature instead of manually redefininig variables and files.
* meson: Add options to define whether to install and where test utilsMarco Trevisan (Treviño)2019-09-241-2/+21
| | | | | | | | | | | | | | | | | Since commit 8ae99192 we provide tracker test utils python modules. These are installed by default in tracker internal libdir, and as per meson default this is an arch-dependent path, while the test utils aren't. So in some distributions, not to provide such files in multiple packages for each architecture, we'd need to install those files somewhere else that is not arch-dependent. Unfortunately meson doesn't provide such path by default (which ideally would be /usr/lib/tracker-${abi-version}), and I think isn't correct either to install such files into the datadir, so in order to make this path customizable and at the same time to make it possible to locate, provide meson options and build a pkg config file for it, providing the python path variable that should be used.
* trackertestutils: Log when the D-Bus daemon has stoppedSam Thursfield2019-09-221-0/+1
| | | | | | I saw a test block after the 'Stopping 2 pipe reader threads' message. This extra log message will help us narrow down the problem when it reoccurs.
* trackertestutils: Ignore CTRL+C in interactive shellsSam Thursfield2019-09-173-17/+32
| | | | | | This fixes a problem in the run-uninstalled script where CTRL+C would kill the D-Bus daemon associated with an interactive shell, breaking everything.
* functional-tests: Don't ignore failures in ipc/ testsSam Thursfield2019-09-141-1/+5
| | | | | | | This fixes a regression introduced in 14e557aad2675c8a07f680a2. Tracker Sandbox now passes on the returncode from the subprocess so that failing tests are noticed by `meson test` as expected.
* Rework the tracker-sandbox utility (again)Sam Thursfield2019-09-144-414/+490
| | | | | | | | | | | | | | | | | This fixes https://gitlab.gnome.org/GNOME/tracker/issues/111 and also simplifies the instructions in the README for running Tracker from the build tree. The sandbox utility is now executed from the top directory by running: python3 -m utils.trackertestutils Previously, due to importing stuff from trackertestutils. you needed to run it from the utils/ directory or set PYTHONPATH appropriately. Additionally, tracker-miners.git will ship a 'run-uninstalled' script to provide convenient access to the sandbox script and allow running Tracker from the build tree.
* trackertestutils: Use default timeout when calling tracker-store D-Bus methodsSam Thursfield2019-09-141-6/+6
| | | | | | | | | | | The default timeout of a GDBusProxy object is 25 seconds, but we were reducing that to 5 seconds. This resulted in occasional test failures (especially in functional-07-graph). (The test failures would occur on systems with many CPUs where the tests ran in parallel, which in practice meant they only failed in GitLab CI. I found that I could reproduce the failure locally by running `meson test --num-processes=100` though.)
* functional-tests: Terminate Tracker processes before the message busSam Thursfield2019-09-144-1/+149
| | | | | | | | | | This reduces the volume of criticals like this that we see in the log output: (tracker-miner-fs:14955): GLib-GIO-CRITICAL **: 11:38:40.386: Error while sending AddMatch() message: The connection is closed I did still see one test that output a bunch of similar criticals from tracker-extract.
* utils/sandbox: Add --index-tmpdir optionSam Thursfield2019-09-141-2/+18
| | | | This makes the tracker-sandbox utility more useful as a test harness.
* utils/sandbox: Add --dbus-config optionSam Thursfield2019-09-141-3/+5
| | | | | This allows tracker-sandbox to be used as a test runner for when the daemons are not yet installed.
* functional-tests: Start daemons through D-Bus autolaunchSam Thursfield2019-09-145-343/+288
| | | | | | | | | | | | | | Instead of manually running and managing Tracker daemon processes manually in the test, we now rely on our private D-Bus daemon to do so. This makes the test environment more like a real Tracker deployment. Log output from the D-Bus daemon is now captured and output through the Python logging system. This allows for finer-grained filtering of output from the tests themselves and from the Tracker daemons. Some test code is changed to support the new model.
* Merge branch 'wip/carlosg/sparql1.1' into 'master'Sam Thursfield2019-09-121-1/+2
|\ | | | | | | | | Fully implement sparql1.1 query/update recommendations See merge request GNOME/tracker!131
| * functional-tests: Remove timeout on all situations that existsCarlos Garnacho2019-09-101-1/+2
| | | | | | | | | | There may be a timeout id without a .poll(), so make sure we don't leave the idle function running.
* | Simplify the tracker-sandbox tool and improve log outputSam Thursfield2019-09-101-404/+228
|/ | | | | | | | | | | The `tracker-sandbox` tool is now a thin wrapper around the `tracker` CLI. Effectively, this commit removes all functionality except the old '--shell' mode. This way we avoid duplicating code paths and we make sure that everyone is using and testing the `tracker` CLI. The sandbox tool now captures all log output from the Tracker daemons, instead of having them print directly to stdout. The old behaviour is now enabled with the `--verbosity=` argument.
* trackertestutils: Install mainloop.py fileSam Thursfield2019-08-271-0/+1
| | | | I forgot about it!
* functional-tests: Merge changes to 'helpers' module from tracker-miners.gitSam Thursfield2019-08-232-23/+332
| | | | | | There are various features which were implemented in tracker-miners.git since it was split from tracker.git which never made their way into tracker.git.
* functional-tests: Remove unnecessary Python shebagsSam Thursfield2019-08-231-1/+0
| | | | | These are still needed for the test modules, but they are not needed in the helper modules.
* functional-tests: Add 2019 copyrightSam Thursfield2019-08-232-0/+21
|
* functional-tests: Move the 'helpers' module into 'trackertestutils'Sam Thursfield2019-08-232-0/+333
|
* functional-tests: Add new trackertestutils moduleSam Thursfield2019-08-235-0/+91
| | | | | | | | | | | 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.
* util/sandbox: Avoid misleading error messageSam Thursfield2019-08-071-3/+1
| | | | | | This error message no longer shows during normal operation: Unexpected error: No such file or directory /home/sam/tracker-temp/run/dbus-session
* build: Correctly hide static libtracker-sparql-intermediate librariesSam Thursfield2019-07-141-1/+1
| | | | | | | | | | | | | | | These libraries were listed as dependencies of libtracker-sparql, causing them to be linked into everything further down the dependency chain. This worked fine in the normal case, but broke when link-time optimization (Meson's -Db_lto option) was enabled. I probably did this because otherwise the libtracker-sparql/tracker-sparql-2.0.vapi file doesn't get linked automatically into the dependencies. We can't use the 'source' option of `declare_dependency()` because this confuses Meson, but we can manually add it in the 3 places that we actually use it. Fixes https://gitlab.gnome.org/GNOME/tracker/issues/117
* utils/sandbox: Misc PEP-8 cleanupsJean Felder2019-05-231-52/+58
| | | | | | | | * Remove unused imports * Use the "with open" syntax * Rewrite some strings to limit all lines to a maximum of 79 characters. * Do not use the equality operator to compare False and None
* utils/sandbox: Don't set environment variablesSam Thursfield2019-05-221-6/+0
| | | | | | | These aren't needed any more and actually prevent the Tracker store from finding its ontologies. As long as the binaries aren't relocated after they installed, Tracker should be able to find all its data files without any help.
* utils/sandbox: Separate --search and --query optionsSam Thursfield2019-05-221-10/+31
| | | | | | It's now possible to do a fulltext search using --search, or a SPARQL query with --sparql. This brings the sandbox tool in line with the `tracker` CLI.
* utils/sandbox: Be clearer when we are reusing a D-Bus sessionSam Thursfield2019-05-221-2/+2
| | | | | This can cause errors if the session file is stale, so it needs to be obvious when this is happening.