Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving CI testing time #70

Merged
merged 2 commits into from
Jan 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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