Skip to content

Commit

Permalink
[ci] use x3 parallel execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Palazzetti committed Jan 24, 2017
1 parent 8d5de5d commit 57fd86f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 18 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
22 changes: 4 additions & 18 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 Down Expand Up @@ -41,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 57fd86f

Please sign in to comment.