1

I have a number of Feature modules for which I've written tests to assure they work as expected. For performance reasons, I've overridden the parent's setUp() method in each test case so that it doesn't create a brand new database each time.

When I run my tests in the SimpleTest admin UI, all of my Feature modules' tests take about 15-20 seconds total to complete. When I run them via drush test-run [feature-group-name], they take about 75 seconds total. I noticed that drush seems to pause in between test cases to output something like the following:

Contact page 7 passes, 0 fails, and 0 exceptions  [ok]
No leftover tables to remove.                     [status]
No temporary directories to remove.               [status]
Removed 1 test result.                            [status]
 Group  Class  Name

If you're curious, my setUp() function looks like this:

public function setUp() {
  $this->setup = TRUE;
  // Prevent PHP warnings about a missing public_files_directory variable:
  $this->public_files_directory = variable_get('file_public_path');
}

Any ideas why drush is so much slower than the admin UI? I'd really like to get drush more performant, as I want to integrate these tests into a continuous integration environment.

Thanks!

6

Consider using "php scripts/run-tests.sh" instead of "drush run-test". The former supports parallel test execution which improves runtime (as long as you have multiple test-classes). Compare:

$ php scripts/run-tests.sh --url http://d45.l User
...
Test run duration: 11 min 45 sec
$ php scripts/run-tests.sh --url http://d45.l --concurrency 3 User
...
Test run duration: 4 min 13 sec
$ php scripts/run-tests.sh --url http://d45.l --concurrency 6 User
...
Test run duration: 3 min 7 sec

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.