The idea of automated testing using SimpleTest has been around almost as long as the SimpleTest module itself. A movement to accomplishing this has been centered at testing.drupal.org and the following projects:
The goal is to have all patches against Drupal 7 core, over 1000 currently, automatically tested to ensure that they apply and pass the suite of tests which consists of over 5500 individual assertsions for about 70% code coverage. Completing this goal has been long in the making by a number of individuals, who have been focused on Drupal 4.7, 5, and 6, but now appears to be realized. Being heavily involved in SimpleTest development, I have taken on the task of finishing up the automated testing framework to be compatible with Drupal 7 and SimpleTest core.
Hurdles
The automated testing framework was designed to support Drupal 4-7 through a 5.x module. This approach worked well, but with the recent explosion in SimpleTest 7.x development the workflow and design has been changed.
Changes from previous SimpleTest version to 7.x:
Goal
The desired workflow is described below.
Steps
This will provide a very consistent way to test files that will allow for scaling in the event that additional servers are necessary to deal with the patch load.
Solution
The previous framework is described at http://testing.drupal.org. The new framework is based heavily off the old framework, but runs in Drupal 6, has been re-written, and is better suited for running tests against Drupal 7.
The re-written code resides as Project Issue File Review. The single module can act as any combination of the three roles: project server, testing master server, and testing slave. That means that the current single server that testing.drupal.org has available can act as both the testing master server and a testing slave. This setup can encompass internal business testing on a single server as well.
The module addresses the hurdles in several ways.
Advantages
Some may wonder why I re-wrote the existing code, there are several reasons.
What to expect
Summary of files per node
To view a list of all the files reviewed for an individual node you would enter a URL like: http://testing.drupal.org/pifr/view/1/9 where 1 is the project server ID, could be replaced by textual "drupal.org", and 9 is the issue node ID. All the files that testing.drupal.org is aware of will be displayed along with their current status and testing result. The possible status values are: Queued, Sent to slave #, and Reviewed. This allows developers to check on a files testing status at any time. Although not displayed the comment ID is also stored for future auto commenting back on drupal.org issues.
Detailed test results
Upon clicking "View results" the detailed assertions will be displayed from the tests run. Currently this consists of a dump by test case. In the future this will hopefully look more the like the standard SimpleTest interface in Drupal 7. That will be handled in core when the test results layer is abstracted. I have already created a patch to begin this with the separation of test selection and test results. Once completed I will attempt to further cleanup the results display to work nicely for testing.drupal.org and any other modules that wish to integrate with SimpleTest. That will also allow this results page to be easily updated with the latest improvements to the SimpleTest results display.
Status summary
In addition to checking the status on individual files the overall status of the queue and testing slaves can be viewed by entering the URL: http://testing.drupal.org/pifr/status. The operations will only be visible to administrators. This will give an a general feel for the load being put on the testing infrastructure and allow for easy reset of a slave server when they crashes.
What is left
There are several things left to be done, some of which require the community's involvement.
Patch criteria and workflow
This is the one area that needs to be flushed out. As many may have noticed when testing.drupal.org was turned on to simply test if patch applied to the current development branch, refereed to as HEAD, it created a number of issues. The following are issues that need to be resolved.
One advantage with sending patches right when they are posted is that the logic about when to comment back can be put on testing.drupal.org as opposed to having a shared more complex logic on both drupal.org and testing.drupal.org. Since all that is sent is the node ID, comment ID, and file URL it shouldn't be a load on drupal.org.
Comments are appreciated, but keep in mind that the code is still being developed and there are a few things I will add before attempting to install on testing.drupal.org. Part of which is a Drupal 5 piece of code to send files, I might just modify the previous framework for that.
Comments
workflow
Really nice work getting this moving again, it's a wonderful thing to see.
* When should patches be sent to testing.drupal.org from drupal.org: right away or wait for cron?
Both, ideally. Patches which apply cleanly and cause no test failures one day, can have failed hunks and use APIs that have changed the next (#value to #markup and many more). So our best bet would be an initial test when the patch is posted, but then daily sweeps through the entire RTBC and CNR queues so that people are notified when patches need re-rolling, and to save reviewers doing this manually. A combination of these will free up a lot of time for reviewing patches that actually work.
* If newer patch is posted when test results are returned should the auto comment still be sent?
Probably not.
* Should the workflow be amended to have something like patch(tested) between patch(needs review) and patch(review & tested by the community).
I don't think so - if a patch fails testing, it should be Code Needs Work, if it passes testing, then it's ready for review.
* What should comment text contain? Link to testing results, message, both, etc?
As short a message as possible with a link to results (possible just passed/failed). The most important thing for me is that the status changes when it fails.