Home / Taxonomy term

testing

Part 1: Drop everything and Help module maintainers fulfill their d7cx pledge

Drupal 7 RC 1 needs testers. And now more than ever, your favorite modules need testing too. As Moshe wrote yesterday, they're here to collect on the D7CX pledge. This is a great way that a new Drupal user can make a significant contribution, and make some friends in the process :)

I was amazed at the most recent DrupalCamp in Ireland that some people I spoke to weren't trying out Drupal 7 yet. I've been using Gardens so much, I adore D7 and get all itchy when I use D6. Come in, the water's fine!

Well, except that many of your favorite modules aren't quite ready yet. Many module maintainers took the D7CX pledge to be ready for the release of Drupal 7. That looks to be in about 7-10 days! There's a mad rush on and even as a non-coder, or a new user to Drupal you can help.

Download Drupal 7, and test your favorite modules. Report bugs and submit patches! It's easy, right? I'll be making a few posts this week to take "the scary" out of testing patches, and show you exactly how I do it. In this post, we'll get D7 up and running, and determine the best way to locate modules which need help, and the specific issues which need testing.

Calculating test coverage

Here's how you can determine test coverage of your tests by generating a report like this one:
http://acquia.com/files/test-results/index.html

Step 1: Install xdebug php extension. On ubuntu I run
apt-get install php5-xdebug

Step 2: Checkout simpletest trunk anywhere on your disk. In this example I will choose /usr/local/simpletest
svn co \  https://simpletest.svn.sourceforge.net/svnroot/simpletest/simpletest/trunk \ /usr/local/simpletest

Step 3: Add simpletest to the php.ini loaded by apache.

Drupal CLI utils

I put together a few scripts that I needed to configure and manage drupal from CLI.

They include the following scripts:
- Installer (install.php D6 & D7)
- Updater (update.php)
- Code Coverage (working example: http://acquia.com/latest-drupal-test-results)
- Unit Test Runner (run-tests.sh)
- Module enabler

and the following library code:
- CLI arg parser
- Drupal Web Form User Agent (uses php-curl)

additional points:
- Much of the code has unit tests (simpletest, php-mock-functions w/o runkit)
- Code was designed to be extended for custom purposes.