I'm trying to speed up my test. I have to use simpletest_clone. I've read something like "copy the database to memory" but i did some research and didn't found how. Aaand if i want to do more than one test with the same database there is somehow a thing that let you use the same database cloned for the first case i tested to be still loaded to run the next test case? because if i want to run 4 or 5 test case using simpletest_clone it may take years if i let it clone and drop the database for every case
There are few ways of speeding up the Simpletests:
- Consider upgrading your PHP to >5.5 with cache benefits of OPCache.
- For PHP <=5.5 try to implement PHP caches such as XCache, APC, eAccelerator.
- Install and configure memcached.
Patch your Simpletest to exclude testing of disabled modules.
Use SimpleTest Clone
(consider patching the module to exclude some big tables while cloning).
Optimize your MySQL instance e.g. via MySQLTuner-perl.
- For sites that have lots of slow queries, disk access is often the bottleneck. So speed up by moving MySQL temporary directory to tmpfs., How to setup mysql on tmpfs?
- Test only specific Simpletests groups that you need.
Other option to consider:
- Try to identify the bottleneck and upgrade your hardware.
- Break down simpletests into groups and run on separate machines.
- Forget about the speed by integrating Simpletests with Continuous integration (CI) such as Jenkins, Travis CI, AWS, etc.
- Use alternative test frameworks (e.g. PHPUnit), see: [meta] Replace the testing framework with PHPUnit and possibly rewrite Simpletest.