Hello Jacques,

Jacques Le Roux <jacques.le.r...@les7arts.com> writes:

> Le 21/11/2018 à 17:43, Jacques Le Roux a écrit :
>> Le 17/11/2018 à 20:12, Mathieu Lirzin a écrit :
>>> For services I think the business logic and validation of data contained
>>> in services could often be extracted in separate unit testable methods
>>> which would allow cheap better case coverage to complement the
>>> integration test which is about checking that the service has the
>>> expected effect on the database.
>> Hi Mathieu,
>>
>> I see only one possible tiny drawback with this solution.
>>
>> I don't know you but most of the time, for small changes, I don't launch the 
>> integration tests, they are too long.
>> I wait for Buildbot feedback, which is most of the time not surprisingly 
>> good.
>>
>> Now every time we build OFBiz, the unit tests pass. Currently we have around 
>> thirty of them and they pass very quickly.
>> How many time it will take when we will have hundreds, if not thousands of 
>> them?
>>
>> Even if it's a small population, maybe we can already estimate an average 
>> time from the thirty we have?
>>
>> Thanks
>>
>> Jacques
>>
>>
> OK, I can answer to myself on this. This is not a problem at all.
> If someone thinks the test are too long in a particular circumstance
> s/he can use the same strategy that I often use for integration tests:
> skip them with "build -x test" and let Buildbot do the the work.

I think it is a good idea to run the unit tests before each commit which
is one of the reason why unit tests must be fast.

Currently we have 54 unit tests which takes 3+ seconds to compile and 7+
seconds to run on my machine.

To make this measurement I have deleted the ‘build’ directory.  Then I
have run the ‘classes’ task to compile every non test related classes.
I have measured the test compilation time with the ‘testClasses’ target
and test run time with the ‘test’ target.

Without considering the constant JVM warmup time and assuming linear
scalibity we could run about 400 unit tests in a minute.  However we
should expect better scalibity with modern multicore processors, since
unit tests are highly parallelizable because they don't rely on IO.  As
a consequence I bet we could have a few thousands of unit tests run in
less than a minute.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

Reply via email to