directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject About tests and Ldif injection annotations (completed)
Date Mon, 09 Feb 2009 16:52:25 GMT
Hi guys,

the cool annotations we have, combined with the rollback system,
allows us to run tests without any problem. Each test can play with
data without interacting with the other tests. However, as the LDIF
injection is done globally for each test, the rollback is also done
globally. ie, if you inject a lot of data, you will have to revert a
lot of data too, for each single test.

We are using it today for one of our client, and as we have around 400
entries to inject for our tests, it takes more or less a couple of
seconds to run each test. At the end of the day, when we run our 150
tests, we have to wait 10 minutes to run all of them.

The data we are injecting are not likely to change often, and we would
rather prefer to inject them only once per class, and be able to
revert them only when all the methods are run. Even better, if we
define a suite, we should be able to inject all the data when the
suite starts, and reverts when it's done.

The current system does not allow such a possibility.

I have tested something on the core tests : I inject the LDIFs at each
level (suite, class and method), and revert accordingly. (when I run a
test, I just inject the associated LDIFs, and I revert them, but don't
revert the class ldif or the suite ldif).

No need to tell that it's way faster ! I was able to run the
SearchITest in less than 5 seconds compared to the usual 15 seconds
for the very same tests (and i'm just talking of 4 entries injected
and rollbacked for every tests).

So I think this is the way to go. The only difficult point is that we
have to deal with 5 different modes for tests :
- PRISTINE
- RESTART
- ROLLBACK (the default)
- CUMULATIVE
- NOSERVICE.

To me, the RESTART, CUMULATIVE and NOSERVICE mode seems a bit useless.
The PRISTINE mode is used for one single test in which we declare two
different factories, hence the need to clean up completely the server.

I would suggest we get rid of the RESTART, CUMULATIVE and NOSERVICE
mode in order to ease the implementation of my small improvement
(otehriwse, there are too many cases to deal with, and i don't realy
have time for that).

wdyt?

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com

Mime
View raw message