Continuous integration - how do you do it?

Hi All,

In the absence of any clear picture about whether damagecontrol is a
practical option for continuous integration, I set up the following
scripts on my server to run the rails functional and unit tests each day
and mail me the results:

::::::::::::::
run_functional_tests.sh
::::::::::::::
#!/bin/bash

cd /var/www/ruby/srjoseph/prometheus
rake test_functional &> /tmp/tmpfile_dis_dev_func
more /tmp/tmpfile_dis_dev_func | mail -s “$( grep ‘[:digit:]* tests,
[:digit:]*’ /tmp/tmpfile_dis_dev_func)” [email protected]
rm /tmp/tmpfile_dis_dev_func

::::::::::::::
run_unit_tests.sh
::::::::::::::
#!/bin/bash

cd /var/www/ruby/srjoseph/prometheus
rake test_units &> /tmp/tmpfile_dis_dev_unit
more /tmp/tmpfile_dis_dev_unit | mail -s “$( grep ‘[:digit:]* tests,
[:digit:]*’ /tmp/tmpfile_dis_dev_unit)” [email protected]
rm /tmp/tmpfile_dis_dev_unit

Now these are a bit of a hack but they do the job as long as you don’t
make the mistake that I did which is to run them at the same time using
cron:

root@my-machine:/var/www/ruby/srjoseph/prometheus # crontab -l -u
www-data
0 1 * * * /var/www/ruby/srjoseph/prometheus/run_unit_tests.sh
0 1 * * * /var/www/ruby/srjoseph/prometheus/run_functional_tests.sh

because then you’ll get db errors as one process is tearing down the
test db while the other one is trying to build it etc.

Anyhow, I would be very interested to hear how others are achieving
continuous integration with rails.

CHEERS> SAM