This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/101790/

nepomuk/services/strigi/strigiservice.h (Diff revision 2)
45
        		IndexScheduler::IndexingSpeed speed = IndexScheduler::SnailPace );
I would prefer a method which is also exposed via DBus. This makes sense in any case. I would often like to change the indexing speed for manual testing for example.

But for that I would not use the IndexScheduler enum but an int which directly expresses the delay between files.

Then we could even change the enum to have msec values or even replace it by static const ints.

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
50
void IndexerTests::testSimpleIndexing() {
Please follow the code indentation policy in KDE. Methods do not use trailing brackets.

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
82
	KConfig* config = new KConfig("nepomukstrigirc" );
KConfig objects are typically created on the stack. The only "advantage" of this approach is a nice memory leak. ;)

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
84
	config->group("General").writePathEntry("folders", QDir::currentPath().append("/testdata"));
Is QDir::currentPath() really appropriate? The test could be started from anywhere? How about a cmale config files which puts the actual path to the test data into the source file?

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
87
	Nepomuk::StrigiService s(NULL, QList<QVariant>(), IndexScheduler::FullSpeed); // This should start the strigi service and index scheduler.
"NULL" is a C definition. Please use "0" instead.

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
89
	bool gotSignal = QTest::kWaitForSignal(&s, SIGNAL(indexingStopped()), 15000);
Superfluous variable.

nepomuk/tests/indexertests.cpp (Diff revision 2)
using namespace Nepomuk;
110
QTEST_KDEMAIN(IndexerTests, NoGUI)
#include "indexertests.moc"

This is just policy and slightly improves compilation performance since the moc file does not have to be compiled independently.

nepomuk/tests/lib/nepomukserverrc.in (Diff revision 2)
1
[Basic Settings]
Hm, how about we add a command line parameter to nepomukserver which specifies which services to start. Otherwise new services not mentioned in this list will be started.

nepomuk/tests/lib/testbase.cpp (Diff revision 2)
Nepomuk::TestBase::TestBase(QObject* parent)
53
    d->m_serviceManager = new org::kde::nepomuk::ServiceManager( "org.kde.NepomukServer", "/servicemanager", QDBusConnection::sessionBus() );
This is never deleted.

nepomuk/tests/lib/testbase.cpp (Diff revision 2)
Nepomuk::TestBase::TestBase(QObject* parent)
64
    Q_FOREACH( const QString & service, services )
See comment about the nepomukserver parameter. Once we have that there is no need to stop services here.

nepomuk/tests/lib/testbase.cpp (Diff revision 2)
Nepomuk::TestBase::TestBase(QObject* parent)
84
{
This is IMHO unclean. It would be best to simply stop Virtuoso, recreate the DB from the tar and restart Virtuoso.

The removeAllStatements is not really public API anyway anymore and the storage service does create some information we might miss here.

This, however, has a low priority for me. :)

nepomuk/tests/test/filewatch/filewatch.cpp (Diff revision 2)
namespace {
51
    // It's hard to believe that Qt doesn't provide its own copy folder function
KIO can do that for you.

nepomuk/tests/test/filewatch/filewatch.cpp (Diff revision 2)
namespace {
54
        
Tabs are evil. :P

nepomuk/tests/test/filewatch/filewatch.cpp (Diff revision 2)
namespace {
84
    bool removeDir(const QString &dirName)
Again KIO can do this.

nepomuk/tests/test/filewatch/filewatch.cpp (Diff revision 2)
namespace {
134
    QTest::qSleep( 4000 );
This is very ugly. How about we add a signal to the filewatcher DBus interface which is emitted once the filewatcher has handled its queue.

nepomuk/tests/test/filewatch/filewatch.cpp (Diff revision 2)
namespace {
176
QString FileWatchTest::createTempDir()
Use KTempDir instead.

- Sebastian


On June 28th, 2011, 7:31 a.m., Paweł Paprota wrote:

Review request for Nepomuk.
By Paweł Paprota.

Updated June 28, 2011, 7:31 a.m.

Description

This is a little ground work for writing integration tests in order to test Nepomuk components in the "real" setup - with D-Bus/socket communication, Virtuoso repository, KConfig configuration running etc.

Also included are simple tests for indexing of files (see indexertests.cpp).

See README for details.

The code is also available here:

https://github.com/ppawel/kde-runtime/tree/integration-tests

Testing

Tests should execute with simple "make test". I did however have some problems (segfaults) with sendEvents method that notifies the user that "indexing started for fast search" - I had to disable it locally, I will try to track down the cause of this if it is reproducible.

Diffs

  • nepomuk/CMakeLists.txt (c6a1879)
  • nepomuk/services/strigi/indexscheduler.cpp (56914a7)
  • nepomuk/services/strigi/nepomukindexer.h (08abb2a)
  • nepomuk/services/strigi/nepomukindexer.cpp (d796983)
  • nepomuk/services/strigi/strigiservice.h (2eb7eac)
  • nepomuk/services/strigi/strigiservice.cpp (0189679)
  • nepomuk/tests/CMakeLists.txt (PRE-CREATION)
  • nepomuk/tests/README (PRE-CREATION)
  • nepomuk/tests/indexertests.h (PRE-CREATION)
  • nepomuk/tests/indexertests.cpp (PRE-CREATION)
  • nepomuk/tests/lib/CMakeLists.txt (PRE-CREATION)
  • nepomuk/tests/lib/NepomukTestLibMacros.cmake (PRE-CREATION)
  • nepomuk/tests/lib/nepomuk-repository-with-ontologies.tgz (PRE-CREATION)
  • nepomuk/tests/lib/nepomukserverrc.in (PRE-CREATION)
  • nepomuk/tests/lib/nepomuktest_export.h (PRE-CREATION)
  • nepomuk/tests/lib/testbase.h (PRE-CREATION)
  • nepomuk/tests/lib/testbase.cpp (PRE-CREATION)
  • nepomuk/tests/runNepomukTest.sh (PRE-CREATION)
  • nepomuk/tests/test/CMakeLists.txt (PRE-CREATION)
  • nepomuk/tests/test/filewatch/CMakeLists.txt (PRE-CREATION)
  • nepomuk/tests/test/filewatch/filewatch.h (PRE-CREATION)
  • nepomuk/tests/test/filewatch/filewatch.cpp (PRE-CREATION)
  • nepomuk/tests/test/identificationtest.h (PRE-CREATION)
  • nepomuk/tests/test/identificationtest.cpp (PRE-CREATION)
  • nepomuk/tests/testdata/CMakeLists.txt (PRE-CREATION)
  • nepomuk/tests/testdata/klogo.png (PRE-CREATION)
  • nepomuk/tests/testdata/trollface.jpg (PRE-CREATION)

View Diff