KDE PIM/Akonadi/Testing: Difference between revisions

From KDE TechBase
(Document current unittest setup)
(Update libakonadi unittest section.)
Line 63: Line 63:
=== kdepimlbs/akonadi ===
=== kdepimlbs/akonadi ===


Better coverage than the above, but require special setup that destroys the data of the database of the regular Akonadi server instance.
These tests use the Akonadi Testrunner, the test environment is found in ''kdepimlibs/akonadi/tests/unittestenv''.


* test data from kdesupport/akonadi/server/src/storage needs to be applied before every run, using the ''make-unittest-mysql-embedded.sh'' script
==== Setup ====
* add the following symlinks:
** ''~/.config/akonadi'' -> ''~/.kde-unit-test/xdg/config''
** ''~/.local/share/akonadi'' -> ''~/.kde-unit-test/xdg/local/share''


This needs porting to the Akonadi Testrunner, to avoid the aforementioned setup.
The tests do not yet completely work without having certain components installed, namely:
 
* Akonadi Server
* KNUT resource
 
==== Running the tests ====
 
The tests can be run automatically using ctest/make test as usual.  To run a single test manually, it needs to be executed using the Akonadi testrunner:
 
<code>
$ cd kdepimlibs/akonadi/test
$ akonaditest -c unittest/config.xml $BUILDDIR/test_executable.shell
</code>


=== kdepim/akonadi ===
=== kdepim/akonadi ===

Revision as of 13:02, 1 February 2009

Akonadi Test and Benchmark Infrastructure

Akonadi Testrunner

Igor's GSoC project, found in kdepimlibs/akonadi/tests/testrunner.

Documentation based on Igor's mail to kde-pim ML:

First you need create a configuration file in KStandardDirs config resource type (try to use: kde4-config --path config, to find the path in my case the path is /usr/share/kde4/config) , the configuration file is a xml and look like:

<config>

 <kdehome>/home/igor/kde/installs/trunk </kdehome>
 <confighome>/home/igor/codes/kde/tests/test_akonadi/</confighome>
 <datahome>/home/igor/codes/kde/tests/test_akonadi/data</datahome>
 <agent>akonadi_ical_resource</agent>
 <agent>akonadi_vcard_resource</agent>
 <item location="/path/to/file.vcf"
       collection="akonadi_vcard_resource_0"/>

</config>

After that you only needs to run the testrunner:

%./akonaditest

and it creates a shell script file in your current directory called testenvironment.sh and you just need to run it.

%source testenvironment.sh

And right now you have a self contained Akonadi server.

KNUT Test Data Resource

In kdepim/akonadi/resources, fully featured resource that operates on a single XML file. File format is decribed in knut.xsd and follows closely the internal structure of Akonadi. New files can be created in eg. Akonadiconsole by creating a resource and specifying a non-existing file.

Akonadi Scriptable Resource

Second part of Igor's GSoC project, currently in playground/pim/akonaditest.

TODO

Akonadi Benchmarker

In kdepimlibs/akonadi/test, part of Robert's thesis.

TODO

Unittests

Akonadi Server

Usable without installation, run with ctest/make test as usual.

kdepimlbs/akonadi

These tests use the Akonadi Testrunner, the test environment is found in kdepimlibs/akonadi/tests/unittestenv.

Setup

The tests do not yet completely work without having certain components installed, namely:

  • Akonadi Server
  • KNUT resource

Running the tests

The tests can be run automatically using ctest/make test as usual. To run a single test manually, it needs to be executed using the Akonadi testrunner:

$ cd kdepimlibs/akonadi/test $ akonaditest -c unittest/config.xml $BUILDDIR/test_executable.shell

kdepim/akonadi

Are there any? TODO