Re: [Tracker] Tracker testing environment



On 12/03/12 16:14, Sam Thursfield wrote:
Hi everyone

Hello,

Is there a recommended method for doing Tracker development and
testing it on a desktop where you also have a 'production' Tracker
installation? I wrote a quick script this weekend that gives you a
shell with a test environment where you can play with a build of
Tracker installed in /opt (find it here:
http://afuera.me.uk/junk/tracker-sandbox ), similar to how the
functional tests work. I'm interested if all Tracker developers do
something like this, or use a separate user account, or jhbuild, or a
make install directly into /usr and hope for the best.

I've typically always either used /usr or jhbuild. Though it's possible to do it through /usr/local or another prefix, the usual problems come from the dbus session starting a process in the wrong prefix (at least for me).

This is easily fixed with the right dbus environment set up, but i've always been too lazy to do that properly locally. :)

https://live.gnome.org/Tracker/Documentation/Debugging doesn't have
too much useful info, I was thinking of adding whatever comes out of
this discussion up there and maybe into a HACKING / README in the git
tree as well. I worry that if it's not trivial for me to work out the
best way to test out changes without messing up my real tracker-store,
it could be quite a big barrier to new contributors who'll find
themselves in a sort of "make, make install, what now??" situation.

There are a bunch of things you can do to make life easier but i've never really got round to doing them all at any one time, for example:

 - Set background colour of terminal window or the prompt prefix, e.g.:
   """
   if [ -n "$UNDER_JHBUILD" ]; then
       PS1="[jhbuild] $PS1"
   fi
   """

 - It probably makes sense to have a script which sets up the basics
   like this:
   """
   PREFIX=/local/gtk3
   LOCALSTATEDIR=/local/var
   SYSCONFDIR=/local/etc

   export PATH=$PREFIX/bin:$PATH
   export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
   export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS

   export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
   export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

   export CPPFLAGS=-I$PREFIX/include
   export LDFLAGS=-L$PREFIX/lib

export AUTOGEN_CONFIGURE_ARGS="--prefix=$PREFIX --localstatedir=$LOCALSTATEDIR --sysconfdir=$SYSCONFDIR"
   """

   The hard part about all of this is, you really want a session for
   just tracker, but not per shell as the documentation suggests here:

     ## test for an existing bus daemon, just to be safe
     if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
         ## if not found, launch a new one
         eval `dbus-launch --sh-syntax --exit-with-session`
echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
     fi

   That really requires setting up DBUS_SESSION_BUS_ADDRESS per terminal
   and having a script somewhere which creates a new session. You can
   easily do this creating a file somewhere and reading from that I
   guess.

   There might be more needed than this, it needs testing, but it's
   possible.

I would definitely support putting a script on the wiki or at least linking to it in the source tree. Generally, we don't put the docs in the source tree because they're easier to access via the internet / wiki. Hope this helped,

--
Regards,
Martyn

Founder and CEO of Lanedo GmbH.



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