Skip to content

Continuous_Integration_Testing

Mo Morsi edited this page Jan 4, 2013 · 5 revisions

title: Continuous_Integration_Testing
updated_on: Wed Jun 27 20:45:48 ~~0400 2012\

\
h1. Continuous Integration Testing
\
h2. Overview
\
Each git commit to aeolusproject/conductor triggers a build on Travis
CI. The build executes cucumber and rspec tests using Bundler. No rpms
are installed and no other aeolus services are turned on for these
tests. When the build is complete, an email is sent to the aeolus-devel
mailing list and a notice is sent to \#aeolus on freenode.
\
For current build status:
[http://travis-ci.org/\#!/aeolusproject/conductor](http://travis-ci.org/#!/aeolusproject/conductor)
\
We also evaluated two other CI services. CloudBees would work for us,
but there is a cost to use 64-bit servers and more hours if our tests
uses more then 300 hours per month. OpenShift was also considered, but
ruby 1.9 support is not available yet, and there was a problem executing
cucumber tests . Travis CI was selected because it met our current
requirements which is to run cucumber and rspecs and there isn’t any
overhead with billing.
\
Below are some notes on setting up aeolus with Travis-CI, CloudBees, and
OpenShift. May be of use if in the future we decide to switch to a
different service.
\
h2. Travis-CI
\
Runs rspec and cucumber.\
Supports ruby 1.8.7 and ruby 1.9.3, and many others through rvm.\
Supports x86\_64.\
It is free and donations are encouraged.\
Configuration is through a .yml file. You don’t get your own Jenkins
instance.
\
h3. Setup
\
Create an account on [http://travis-ci.org](http://travis-ci.org). Then
go to the “Admin” section of the aeolus repo on github and select
“Travis” under “Service Hooks”. Enter your travis-ci account name and
token and select active. Then add a .travis.yml configuration file in
the root directory of the git repo and push. The push will also kick off
the first build.
\
The .travis.yml file we are using is here:
[https://github.com/aeolusproject/conductor/blob/master/.travis.yml](https://github.com/aeolusproject/conductor/blob/master/.travis.yml)
\
More detailed instructions can be found on this page:
[http://about.travis-ci.org/docs/user/getting-started](http://about.travis-ci.org/docs/user/getting-started)/
\
h2. CloudBees
\
Runs rspec and cucumber.\
Supports ruby 1.8.7 and ruby 1.9.3.\
Supports x86\_64.\
It is free for 300 hours per month on i386 servers. There is a \$50
monthly plan for x86\_64 servers and more hours.\
Service provides you with your own Jenkins instance.
\
h3. Setup
\
Signup with the service at [http://cloudbees.com](http://cloudbees.com).
Once you are logged in, click on Jenkins Build. This will transport you
to your own Jenkins instance at
[https://](https://)<name-you-chose>.ci.cloudbees.com.
\
Create a new job. Enter the aeolus git repo and branch.
\
Under “Build” create an “Execute Shell” step and enter the following
commands:
\
export USE\_BUNDLER=yes\
cd src\
sed s/’pg’/’sqlite3’/ Gemfile.in \> Gemfile
\
curl~~s ~~o use-ruby
[https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/use-ruby](https://repository-cloudbees.forge.cloudbees.com/distributions/ci-addons/use-ruby)\
RUBY\_VERSION=1.8.7-p357 \
source ./use-ruby
\
gem install~~~~conservative bundler
\
bundle check || bundle install
\
cp ./config/database.sqlite ./config/database.yml\
rake dc:oauth\_keys\
rake db:drop\
rake db:create\
rake db:migrate\
rake db:seed\
rake db:test:prepare\
rake cucumber
\
h2. Openshift
\
Runs rspec. Cucumber doesn’t work.
\
+ bundle exec ‘rake cucumber’\
DEPRECATION WARNING: Calling set\_table\_name is deprecated. Please use
\`self.table\_name = ‘the\_name’\` instead. \
DEPRECATION WARNING: Calling set\_table\_name is deprecated. Please use
\`self.table\_name = ‘the\_name’\` instead. \
/usr/bin/ruby~~S bundle exec cucumber ~~~~profile default\
= boot.rb will try and use bundler =\
= application.rb will try and use bundler =\
Unknown switches ’~~~~profile’

Currently only supports ruby 1.8.7. Backend servers use RHEL 6.3. ruby
1.9.x support is in progress.

Supports x86\_64.

Is free to use for now.

### Setup

Create an Openshift account. After you login, go to “My Applications”
and create a Jenkins Server application. This will create a Jenkins
instance at
[http://](http://)<app name>~~<your account name>.rhcloud.com.
\
Next click on the Jenkins application under “My Applications” and add
the “Jenkins Client” cartridge. This will create a new diy type
application, grant you access to a Build Executor in Jenkins, and allows
you to build remotely hosted applications, say on github, by piggy
backing on the diy application.
\
Now go to your Jenkins instance, click on the diy application name you
created, and configure the job
\
To use 64-bit servers, select “Medium” for “Builder Size”.\
Select “ruby-1.8” or “diy-1.0” for “Builder Type”.\
Enter the aeolus git repo and the branch name.
\
Under “Build” create an “Execute Shell” step and enter the following
commands:
\
export USE\_BUNDLER=yes\
cd src\
sed s/’pg’/’sqlite3’/ Gemfile.in \> Gemfile
\
bundle~~v

bundle check || bundle install —path vendor/bundle

cp ./config/database.sqlite ./config/database.yml

bundle exec rake dc:oauth\_keys\
bundle exec rake db:drop\
bundle exec rake db:create\
bundle exec rake db:migrate\
bundle exec rake db:seed\
bundle exec rake db:test:prepare\
bundle exec rake spec

Clone this wiki locally