Tracker Functional Testing

Functional tests are automated tests for the whole software, once it is installed and configured in the environment. Do NOT confuse it with unit-testing. Unit test is intended to run in the source code tree, while functional tests require a whole installation.

Tracker has a set of functional tests to verify it is working fine in some basic (and not so basic) use cases. Here comes a description on how the test can be run.

Who should read this page? (who run these tests)

  • Developers: specially when a feature is complete. They should add functional tests (if needed) and check that the previous use cases are running correctly or fix them (some new features could require to update the test). Developers can spot regressions with these tests.
  • Maintainers: They can test tracker on their platform, with the libraries available there. It can help to spot crashes or mis-behaviours in certain environments or certain library versions.
  • Contributors: A lot of bugs can be automatically tested with a functional test. They are fixed when the test work and from then on the test acts as a regression control.

What are the functional tests for tracker?

  • The functional tests are a collection of python scripts (with some test-data and helper files). These scripts start tracker with a brand new DB (setting the environment variables to a test location) and perform different actions that tracker should handle correctly. Some scripts only act over the store (inserting/removing/updating and checking the results), other set the miner-fs to monitor some locations and perform operations over the files/folders to check the monitoring/crawling is working fine. Other test the extraction.

How to run the tests

Run all tests from the source code tree (Desktop and Scratchbox/Meego)

These are the steps:

  • Checkout the code from the repo

  • ./autogen.sh [can use different options here]
  • make
  • (sudo) make install

NOTE that is required to install tracker. These are functional tests!

 $ make functional-test

Run manually a test from the source code (Desktop)

As in the "run all", install tracker and:

 $ cd tests/functional-tests
 $ ./01-insertion.py

Run manually a test from the source code (Scratchbox)

As in the "run all", install tracker and:

 $ export SBOX_REDIRECT_IGNORE=/usr/bin/python
 $ cd tests/functional-tests
 $ meego-run ./01-insertion.py

Some common errors

Invalid syntax '@classmethod'

The error looks like this:

  • File "./300-miner-basic-ops.py", line 49
        @classmethod
        ^
    SyntaxError: invalid syntax

It is using an old version of python. On desktop, install a newer python (and make sure is the one running by default). On scratchbox, make sure you have this variable in your environment:

 $ export SBOX_REDIRECT_IGNORE=/usr/bin/python

Projects/Tracker/Documentation/FunctionalTesting (last edited 2013-11-25 12:54:23 by WilliamJonMcCann)