Continuous integration build for Rails

Hi all,

We had an email conversation with Jeremy (aka bitsweat) yesterday, and decided that ThoughtWorks should do something about Rails’ continuous integration.
The idea is to set up a rig that would test new commits against multiple database/OS combinations.

It’ll take some time to implement the whole thing. Just to get the ball rolling I’ve set up a build for ActiveRecord with MySQL here: http://cruisecontrolrb.thoughtworks.com/projects

Your friendly build monkey,
Alex Verkhovsky

Thanks Alex! Do failed builds report to this list? The RSS feed for
builds doesn't seem to be hooked up yet.

Best,
jeremy

Not yet, but they will soon.
The RSS feed is here: http://cruisecontrolrb.thoughtworks.com/projects.rss

I have a few questions, by the way.

  1. How should it go about building ActionPack and other subdirectories? Would it be a good idea to build them all, one by one, within the same build?

  2. What’s the right thing to do with test databases? Arguably, they should be recreated from scratch every time something changes in test/fixtures/db_definitions/. Is this already automated somewhere?

  3. I understand that there is a CI build for ActiveRecord with Oracle and SQLServer. Looking at the scripts used there may help. Where are they to be found?

Alex

Running the "test_mysql" rake test handles it all for you, you just need to make sure your test connection is set up correctly and the databases exist. You'll want a separate test database for each db/platform "project". Look at the RUNNING_UNIT_TESTS file for more info, or shoot me an email off the list.

-- tim

> > It'll take some time to implement the whole thing. Just to get the ball
> Thanks Alex! Do failed builds report to this list?
>
Not yet, but they will soon.
The RSS feed is here:
http://cruisecontrolrb.thoughtworks.com/projects.rss

Thanks!

The ActiveRecord-MySQL page has a dead feed <link> that points to
  http://cruisecontrolrb.thoughtworks.com/builds?format=rss

I have a few questions, by the way.

1. How should it go about building ActionPack and other subdirectories?
Would it be a good idea to build them all, one by one, within the same
build?

Separate builds per Rails component probably makes the most sense.

2. What's the right thing to do with test databases? Arguably, they should
be recreated from scratch every time something changes in
test/fixtures/db_definitions/. Is this already automated somewhere?

aaa_create_tables_test recreates the test database using
test/fixtures/db_definitions/adapter_name.sql, adapter_name.drop.sql,
and schema.rb

3. I understand that there is a CI build for ActiveRecord with Oracle and
SQLServer. Looking at the scripts used there may help. Where are they to be
found?

Contact Michael Schoen for the scripts. He wrote them for the Oracle adapter.

jeremy

The ActiveRecord-MySQL page has a dead feed that points to
http://cruisecontrolrb.thoughtworks.com/builds?format=rss

Right. Thanks for the heads-up, it was just a bug in the default layout. Separate feeds per project is a future release story.

  1. How should it go about building ActionPack and other subdirectories?

Would it be a good idea to build them all, one by one, within the same
build?

Separate builds per Rails component probably makes the most sense.

Umm… not sure. They have dependencies on each other (
e.g. rebuilding activerecord whenever activesupport changes makes sense).

Building them all on every commit is the easiest setup to implement and manage. Is it a bad idea for any reason?

Alex

Building them all on every commit is the easiest setup to implement and
manage. Is it a bad idea for any reason?

I think it's the best bet.

The other thing to consider is the stable branches, but we can cross
that bridge once trunk is all tested.

Thanks again to the guys at thoughtworks for helping out with this.

I use a slightly modified version of Michael Schoen oracle script for
the SQL Server tests. I had to make some slight changes to it so it
would run on Windows. I might also have his Oracle one in my GMail
archive, I can send both of those to you by Monday at the latest.

Rich C.

Alexey: I've just sent off the script, let me know if you have any questions.

This shouldn’t be too hard, indeed.

So, by now, every component is included, except actionwebservice and railties. The builds for these two are broken.

Activerecord is so far built against MySQL only.

I tried to get the build going for SQLite , but it’s blowing up with this not too informative exception below. It’s SQLite 3.3.8 with sqlite3-ruby 1.2.1. Should I downgrade the SQLite3 version to 3.3.7?

Alex

cruisecontrolrb:~/src/cruise/projects/Rails-MySQL/work/activerecord/test cruise$ ruby -I “connections/native_sqlite3” transactions_test.rb -n test_manually_rolling_back_a_transaction

Using native SQLite3
Loaded suite transactions_test
Started
SQL logic error or missing database
/opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/errors.rb:94:in check' /opt/local/lib/ruby/gems/1.8/gems/sqlite3- ruby-1.2.1/lib/sqlite3/resultset.rb:77:in check’
/opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:68:in commence' /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/resultset.rb:61:in initialize’

/opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in new' /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/statement.rb:163:in execute’
/opt/local/lib/ruby/gems/1.8/gems/sqlite3-
ruby-1.2.1/lib/sqlite3/database.rb:212:in execute' /opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:187:in prepare’
/opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:211:in `execute’

/opt/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/lib/sqlite3/database.rb:611:in commit' ./../lib/active_record/connection_adapters/sqlite_adapter.rb:196:in commit_db_transaction’
./…/lib/active_record/connection_adapters/sqlite_adapter.rb:361:in `catch_schema_changes’

./…/lib/active_record/connection_adapters/sqlite_adapter.rb:196:in commit_db_transaction' ./../lib/active_record/connection_adapters/abstract/database_statements.rb:69:in transaction’
./…/lib/active_record/transactions.rb:106:in `transaction’

transactions_test.rb:172:in test_manually_rolling_back_a_transaction' /opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in send
/opt/local/lib/ruby/1.8/test/unit/testcase.rb:72:in run' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in run’

/opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in each' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in run’
/opt/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in run' /opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in each’

/opt/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in run' /opt/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in run_suite’
/opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in `start_mediator’

/opt/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in start' /opt/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in run’
/opt/local/lib/ruby/1.8/test/unit/autorunner.rb:200:in `run’

/opt/local/lib/ruby/1.8/test/unit/autorunner.rb:13:in `run’
/opt/local/lib/ruby/1.8/test/unit.rb:278
transactions_test.rb:207