[Engine-devel] Any way to break the dao_unit_tests up?

Mike Kolesnik mkolesni at redhat.com
Mon Aug 20 05:46:27 UTC 2012


----- Original Message -----
> The DAO unit tests take twice as long as the rest of the test to run
> is
> there any way to break them up into two pieces?
> 

It will not be easy..

The way the tests are built today is with DB-unit.
DB-unit allows to have an XML file with predefined data (called fixtures) which is used to recreate the DB data each time a test-class is run.

This is all fine, except that in our tests there are (at least) 2 issues:
 1. The same fixtures.xml file is used in all DAO tests.
 2. Some DAOs require fixtures for several tables.

Now, we could fix issue #1 by splitting the fixtures file into smaller files, each relating to only one table, which would allow us to run these tests in parallel on the same DB.
Issue #2 would require to figure out which tests require several fixtures, and have them run isolated from the other tests which require only a single table.

A simpler solution could be to have the tests run each on it's own db schema (or it's own db) which eliminates the dependencies and allows to run all in parallel, but is a bit more complicated to maintain (we would need some script that generates these schemas/dbs for tests automatically) and keeping multiple schemas up to date would also require CPU time.

This is speaking in terms of the tests themselves, without considering the build process itself.

> 
> --
> Thanks
> Robert Middleswarth
> @rmiddle (twitter/IRC)
> 
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
> 



More information about the Infra mailing list