Quantcast
Channel: How can I speed up my PHPUnit + DBUnit test suite execution? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

How can I speed up my PHPUnit + DBUnit test suite execution?

$
0
0

I'm running in to some real speed issues with PHPUnit/DBUnit. Anything that extends PHPUnit_Extensions_Database_TestCase takes forever to run. With 189 tests, the suite takes around 8-9 minutes. I was kind of hoping it would take 30 seconds at most ;-)

It looks like restoring the database to its initial state is the process that takes the time, so we've made our datasets as small as possible and limit the number of tables we require for each test case. I am using fixtures and sharing as much as possible.

Are there any settings or modifications I can use to speed the execution up? Looking at what the MySQL server is doing throughout the tests it seems that lots of truncate/inserting is happening, but surely it would be faster to pack the test data sets into temporary tables and then simply select into them for each test?

The driver I'm using is PDO/MySQL with an XML test dataset.


Viewing all articles
Browse latest Browse all 3

Trending Articles