First Look at SimpleTest in Core

I had a little free time today, so I took a look at the new SimpleTest integration for Drupal 7. The SimpleTest framework now comes as a core module, which is a fantastic choice for growing a testing culture. I have only been keeping half-an-eye on the evolution of the testing framework, but I get the impression it bears only a passing resemblance to the original SimpleTest framework.

It looks like you need cURL working with your PHP. Since my dev machine is running XAMPP, all I needed to do was uncomment the line
extension=php_curl.dll
in my xampp\apache\bin\php.ini file, and restart apache.

I turned on the SimpleTest module, went to admin/build/testing and tried running all 67 groups of tests. Not so good. It ran for about 5 minutes, got a little passed 10%, and ran into a fatal exception. Hmm, I wonder if my old popups patch is causing it to choke. I guess I need to pull down a completely clean version of D7 to start with. I wonder if there is an up-to-date report of known failures, like Mozilla has for its products (Tinderbox? Bonsai?). I am also wondering if there is anyway for me to be maintaining the popup patch under a distributed version control system like git or bazaar, so I can track it’s changes in relation to HEAD. So many questions.

I pulled down a fresh

I pulled down a fresh version of head, and testing still drops out somewhere in the comment tests. Now I just need to figure out where I report it.

It looks like catch is maintaining a list of known failures over at http://groups.drupal.org/node/11993. It’s so exciting watching Drupal bootstrap itself into an industrial strength project.

Looks like the test was

Looks like the test was exceeding XAMPP’s default Maximum Execution Time of 60 seconds. And reporting the error in a nice HTML table, which is normally useful, but not if simpletest escapes it before showing it (I suspect simpletest is going to need to do a little php variable sniffing).

I got a good tip from cwgordon7, to add

set_time_limit(0);

in my settings.php file.

Then I was able to run through the whole test with 4625 passes, 26 fails, 0 exceptions. Whole thing took roughly half-an-hour. I wonder how long it will take once we get 100% code coverage.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.