From 8d5de5d050a259ce07eed354dad302b5ffe02a9b Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Tue, 24 Jan 2017 11:52:11 +0100 Subject: [PATCH 1/2] [ci] prevent wrong cache usage, updating the system rubies --- circle.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 938d8db0d03..4305f269951 100644 --- a/circle.yml +++ b/circle.yml @@ -19,9 +19,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 From 57fd86fa5214c9cec072bdb41f074bd45890256d Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Tue, 24 Jan 2017 12:07:53 +0100 Subject: [PATCH 2/2] [ci] use x3 parallel execution --- Rakefile | 29 +++++++++++++++++++++++++++++ circle.yml | 22 ++++------------------ 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/Rakefile b/Rakefile index 53f00106a5d..00990c9b9cb 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/circle.yml b/circle.yml index 4305f269951..4bb1d2696b4 100644 --- a/circle.yml +++ b/circle.yml @@ -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 @@ -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: