Forum: Ruby on Rails continuous integration - how do you do it?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sam J. (Guest)
on 2006-01-23 17:53
(Received via mailing list)
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)" removed_email_address@domain.invalid
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)" removed_email_address@domain.invalid
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
This topic is locked and can not be replied to.