[Nepomuk] Re: Review Request: Setup for integration tests in Nepomuk + a few indexer tests

Paweł Paprota ppawel at fastmail.fm
Tue Jul 5 12:46:45 CEST 2011



> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > Here is what we need to do -
> > 
> > 1. The strigi tests should be in their own directory, like the filewatch tests.
> > 
> > 2. I don't think kde people will approve of adding binary files like images in the kde-runtime repository. So, we might need to put this code in another repository (nepomuk-tests?). Or create a separate kde-runtime-tests. A separate repository wouldn't work right now, cause you're linking to the source files of the indexer. But I don't think that is required.
> > 
> > We should ideally run the strigi service, and then tell it exactly what do to via dbus. The present dbus interface for the strigi service is quite adequate. It just lacks a signal to inform us when a file has finished indexing. That can easily be added. Do you want me to do it?
> > 
> > ---
> > 
> > Btw, thank you very much for working on this. Testing is really important and we've been lacking a formal testing environment for quite some time.
> > 
> > 
> >

I really don't think testing should be restricted by infrastructure - ie. what is possible to commit where etc. I would rather leave this as is, not using D-Bus explicitly. It will be useful to have this kind of code when it's possible to mock remote communication. See also a nice example in Soprano tests - base multithreadingtest.cpp/h and subclass with D-Bus communication for createModel etc. That way you can develop tests quickly with mocks and still have full integration cycle with D-Bus simply by smart subclassing.

As for binary stuff - I don't know what is the policy, will try to find out.


> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > nepomuk/tests/indexertests.cpp, line 56
> > <http://git.reviewboard.kde.org/r/101790/diff/2/?file=25645#file25645line56>
> >
> >     It would be better if you started the strigi service using startService( .. ), and then tell it to index files over dbus.
> >     
> >     Or you could just call the "nepomukindexer" process on the file you want to index, and avoid linking the source files.

No, this is specifically what I wanted to do here.


> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > nepomuk/tests/test/filewatch/filewatch.cpp, line 1
> > <http://git.reviewboard.kde.org/r/101790/diff/2/?file=25657#file25657line1>
> >
> >     I wrote this test really long ago. From what I remember it never worked. Could you remove it?
> >     
> >     Maybe I'll fix it and add it later.

Yes, I will remove it, I added it to the commit by mistake.


> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > nepomuk/tests/indexertests.cpp, line 77
> > <http://git.reviewboard.kde.org/r/101790/diff/2/?file=25645#file25645line77>
> >
> >     Does this test pass? Cause from what I remember, it shouldn't pass.

Yes it does, why wouldn't it?


> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > nepomuk/CMakeLists.txt, line 10
> > <http://git.reviewboard.kde.org/r/101790/diff/2/?file=25636#file25636line10>
> >
> >     I don't think contaminating the global CMakeLists.txt is a good idea. Whatever includes are required should be in the local CMakeLists.txt

IIRC, those includes are needed for various different source folders, that's why I moved it to the root. In general include paths are a mess. I will revisit this and try to move them to more specific places...


> On July 4, 2011, 8:48 a.m., Vishesh Handa wrote:
> > nepomuk/services/strigi/nepomukindexer.h, line 50
> > <http://git.reviewboard.kde.org/r/101790/diff/2/?file=25638#file25638line50>
> >
> >     I've would prefer something like IndexingJob, which makes it obvious it is an asynchronous process implemented via KJob.

I think more important is that it launches nepomukindexer binary using KProcess but if you insist I can change it.


- Paweł


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


On June 28, 2011, 7:31 a.m., Paweł Paprota wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/101790/
> -----------------------------------------------------------
> 
> (Updated June 28, 2011, 7:31 a.m.)
> 
> 
> Review request for Nepomuk.
> 
> 
> Summary
> -------
> 
> 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
> 
> 
> 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 
> 
> Diff: http://git.reviewboard.kde.org/r/101790/diff
> 
> 
> 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.
> 
> 
> Thanks,
> 
> Paweł
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/nepomuk/attachments/20110705/123b869c/attachment.htm 


More information about the Nepomuk mailing list