Testing patches - a DAST use case

Events happening in the community are now at Drupal community events on www.drupal.org.
allisterbeharry's picture

So I volunteered to help test the MSSQL database driver for 5.x and 6.x-dev. Right now Souvent22 is trying to stabilize the install script. So the routine for everybody is:

while (mssql install path != stable) {
1. Checkout DRUPAL-5-1 HEAD
2. Apply mssql patch
3. Delete all the stuff in the test vdir and put in the fresh HEAD
4. drop everything in the SQL Server test database
5. Go to Drupal install page
}

Now after a few iterations this is going to become tedious. So this is what will eventually replace it:

<?xml version="1.0"?>
<project name="Drupal-5-1 mssql driver install test" description="Test-bed for current mssql database driver" default="mssql-install-patch">

<target name="clean" description="Clean the Drupal 5 vdir and database">
<delete>
<!--Delete all files in web folder-->
  <filelist dir="~/www/drupal5/mssqltest"/>
</delete>
<!--DROP the db and user-->
<SQLexec connectionstring="mssql://vanilla@ice@localhost/master" query="DROP Drupal-5-1-mssql-test" />
</target>

<target name="Drupal-5-1-HEAD-new-install" description ="Create fresh Drupal install with current 5-1-HEAD" depends="clean">
  <!--Create the Drupal db and user and permissions with a file script-->
  <SQLexec connectionstring="mssql://vanilla:ice@localhost/master" file="~/dbscripts/create-drupal-51-db.sql/">
  <!--Checkout latest 5.1 HEAD-->
  <CVS command="co" fromdir="pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal" todir="~/www/drupal5/mssqltest" revision="DRUPAL-5-1" module="drupal" />

<target name="Drupal-5-1-HEAD-mssql-patch" depends=Drupal-5-1-HEAD-new-install>
<!--Apply patch to new install-->>
<Patch options="Up0" dir="~/www/drupal5/mssqltest" patchfile="${patchfile}"
</target>
</project>

And that's all there is. Just run phing -Dpatchfile=whatever A completely automated and error-free repeatable way to test the patch. This is just the first set of tasks that could be automated. The remaining testing tasks:
6. go to site
7. select 'mssql' as database
8. set db options (db name, username, pass, port)
9. click install
10. See what happens next...
could also be automated using Phing's SQL and PHPExec taks. Even cooler, how about automatically running unit tests on the patch, and putting the results showing which tests passed and failed and why, in an HTML file. Implementing this use case is going to be one of the first major milestones in the DAST project.

Comments

nice

drewish's picture

that sounds pretty cool. i've been running into similar stuff where i need to repeatedly drop the table, delete the settings.php file, and re-install. i think i'll look into automating that a bit.

SoC 2007

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: