This module is for Drupal 7. It extends the SimpleTest module to allow module developers to run a faster and fully compatible version of it's DrupalWebTestCase test, with a information loss kept near the minimum. It has been created to make test driven development less painful, without having to switch to a different testing framework than the standard one.

To achieve a major speed improvement Quick SimpleTest caches parts of the setUp() method of the test run, which gets called before every test method.
This takes a very long time to finish up, because it will install a hole Drupal environment and then enable a list of requested or required modules. This module will make save marks after these two operations and on the next call to setUp() it will start from them.

Note: There is some code copy pasted from SimpleTest, because this module will have to override some of it's method, but only needs to change some parts of it, or change the order of execution.

My project page
Git access:
git clone --recursive --branch 7.x-1.x git.drupal.org:sandbox/gellweiler/1663364.git quick_simpletest

Reviews of other projects:
http://drupal.org/node/1712090#comment-6330444
http://drupal.org/node/1593136#comment-6329018
I have done two comments on this:http://drupal.org/node/1722252#comment-6336218

http://drupal.org/node/1721498#comment-6338116
http://drupal.org/node/1722030#comment-6338570
http://drupal.org/node/1705646#comment-6342050

Comments

Avaneesh’s picture

Hi gellweiler,

I have found some coding standard issues in your code using automated tool. you can check the issues here.You can make the changes and verify the issues at same url after pushing to git.

Regards,
Avaneesh

gellweiler’s picture

Issue summary: View changes

Added a note about code copyed from SimpleTest.

gellweiler’s picture

I have fixed the coding standard issues. There are still a few shown by ventral, but I don't want to change them, because they are copy pasted from SimpleTest.

gellweiler’s picture

Issue summary: View changes

updated git path

gellweiler’s picture

Issue tags: +PAreview: review bonus

Added review bonus.

By the way, I'm really uncontent with this peace of code:

    // Delete remaining test_class entries from database.
    $ids = db_select('quick_simpletest_cache_info', 'i')
    ->condition('i.test_class', $test_classes, 'IN')
    ->fields('i', array('cache_id'))
    ->execute()
    ->fetchCol();
    db_delete('quick_simpletest_cache_info')
    ->condition('cache_id', $ids, 'IN')
    ->execute();
    db_delete('quick_simpletest_cache_info_modules')
    ->condition('cache_id', $ids, 'IN')
    ->execute();

In the module file, but I couldn't find a better way to do a joined delete with db_delete().

gellweiler’s picture

Issue summary: View changes

added a review

gellweiler’s picture

Issue summary: View changes

Added a review of another project.

gellweiler’s picture

Issue summary: View changes

added a review of another project.

gellweiler’s picture

Issue summary: View changes

Added a review.

Milena’s picture

Hi,

about joins in db_delete - I haven't find a way to achieve this by such API. I used something like this in my module:

 $query = "DELETE db FROM {dashboard_blocks} db
    LEFT JOIN {block} b on b.bid = db.bid
    where b.bid is null";
  $result = db_query($query);

As far as I found standard db_query function is still valid, so I used such syntax and I'm not using helper db_select().

I'm not able to do proper manual review because of my lack of knowledge of testing modules and SimpleTest. But here are some things I was able to find.

In your quick_simpletest_form_alter hook profiles sometimes is an array and somtimes boolean value. You probably should keep it consistent. Why won't you use just empty array if directory is empty or profile folder is not a directory?

In your quick_simpletest_form_alter you should use t() function for every string (titles and descriptions).

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for your reviews! When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).

manual review:

  1. "'#title' => 'Enable module caching',": all user facing text should run through t() for translation.
  2. quick_simpletest_form_alter(): you could use file_scan_directory() or similar, no?
  3. "while (FALSE !== ($f = readdir())) {": yoda condition? ;-)

Otherwise looks like good work! RTBC in my opinion.

gellweiler’s picture

Thank you for your reviews. I have made the changes you suggested.

misc’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, gellweiler!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Altert review list