Skip to content

Commit

Permalink
Merge pull request #70 from palazzem/ci-caching
Browse files Browse the repository at this point in the history
Improving CI testing time
  • Loading branch information
Emanuele Palazzetti authored Jan 24, 2017
2 parents ad4ecee + 57fd86f commit 8e70c76
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
29 changes: 29 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,33 @@ task :'release:docs' => :rdoc do
sh "aws s3 cp --recursive html/ s3://#{S3_BUCKET}/#{S3_DIR}/docs/"
end

desc 'CI dependent task; it runs all parallel tests'
task :ci do
# CircleCI uses this environment to store the node index (starting from 0)
# check: https://circleci.com/docs/parallel-manual-setup/#env-splitting
case ENV['CIRCLE_NODE_INDEX'].to_i
when 0
sh 'rvm $MRI_VERSIONS --verbose do rake test:main'
sh 'rvm $LAST_STABLE --verbose do rake benchmark'
when 1
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:monkey'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:redis'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra'
when 2
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres rake test:rails'
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails3-mysql2 rake test:rails'
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres rake test:rails'
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails4-mysql2 rake test:rails'
sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:rails'
sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake test:rails'
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres-redis rake test:railsredis'
sh 'rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres-redis rake test:railsredis'
sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake test:railsredis'
else
puts 'Too many workers than parallel tasks'
end
end

task default: :test
27 changes: 8 additions & 19 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ machine:
services:
- docker
environment:
# FIXME: Disabled $JRUBY_VERSIONS tests because of a Java incompatibility
LAST_STABLE: 2.4.0
EARLY_STABLE: 2.1.10
MRI_VERSIONS: 2.4.0,2.3.3,2.2.6,2.1.10
Expand All @@ -19,9 +20,12 @@ dependencies:
# only docker-engine==1.9
- pip install docker-compose==1.7.1
- docker-compose up -d | cat
# configure Ruby interpreters
# installing dev dependencies
- gem update --system
- gem install builder
- gem update bundler
- bundle install
# configure Ruby interpreters
- rvm get head
- rvm install $MRI_VERSIONS
# prepare and run the trace agent
Expand All @@ -38,24 +42,9 @@ dependencies:
test:
override:
- rvm $EARLY_STABLE --verbose do rake rubocop
# Disabled $JRUBY_VERSIONS tests because of a Java incompatibility
# TODO: integration tests should run with the master branch of the agent
- rvm $MRI_VERSIONS --verbose do rake test:main
- rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:monkey
- rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch
- rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http
- rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:redis
- rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra
- rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres rake test:rails
- rvm $RAILS_VERSIONS --verbose do appraisal rails3-mysql2 rake test:rails
- rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres rake test:rails
- rvm $RAILS_VERSIONS --verbose do appraisal rails4-mysql2 rake test:rails
- rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:rails
- rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake test:rails
- rvm $RAILS_VERSIONS --verbose do appraisal rails3-postgres-redis rake test:railsredis
- rvm $RAILS_VERSIONS --verbose do appraisal rails4-postgres-redis rake test:railsredis
- rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake test:railsredis
- rvm $LAST_STABLE --verbose do rake benchmark
# TODO: integration tests should run with the master branch of the agent
- rake ci:
parallel: true

deployment:
develop:
Expand Down

0 comments on commit 8e70c76

Please sign in to comment.