Re: [Tracker] Tests with tracker



Hi Éloi

On 1/18/17, Éloi Rivard <eloi rivard gmail com> wrote:
I would like to write some tests in an existing program that uses tracker.
I would like to not run tests on the system daemon. I saw that there are
some interesting things here
https://github.com/GNOME/tracker/tree/master/tests/functional-tests

I did not find clear documentation about this topic. I just come here to
check with you if I did not missed some documentation, and take some
advices. So, what do you think about tests?

I think it's a great idea :-)

The current design of Tracker makes it tricky to write tests. I would
like to make it easier to use the Tracker store and the mining and
extraction code within a single process, but that requires a bit of
work.

So the current "state of the art" is to set up a separate D-Bus and
start instances of all the Tracker daemons attached to that bus. This
is done by setting the DBUS_SESSION_BUS_ADDRESS environment variable
for each of the daemon processes. Additionally you set XDG_CACHE_HOME
and XDG_DATA_HOME so that tracker-store places its database elsewhere
instead of overwriting the user's real tracker-store files that are in
~/.cache/tracker and ~/.local/share/tracker. Finally to get a
different configuration you can use the DCONF_PROFILE environment
variable.

There are two implementations of this in tracker.git :-) One you've
spotted in https://github.com/GNOME/tracker/tree/master/tests/functional-tests/.
The D-Bus session bus is set up in test-runner.sh and then in
common/utils/system.py there's the TrackerSystemAbstraction class
which is a helper to set up the rest of the test environment.

The other implementation is the
https://github.com/GNOME/tracker/blob/master/utils/sandbox/tracker-sandbox.py
script which does more or less the same thing, but is a commandline
tool aimed mainly at helping to debug the Tracker daemons.

Neither of these are perfect, improvements to either is welcome.
Ideally we'd merge the two implementations and fully document on the
wiki for folk who want to reuse them.

Sam


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