From cf2846e0aa7cf76d66834b73842c7df37ee75603 Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Wed, 4 Sep 2019 13:35:49 -0400 Subject: [PATCH] Official support for Ruby 2.5 and 2.6 (#802) --- .circleci/config.yml | 159 +++++++++++++++++++- .circleci/images/primary/Dockerfile-2.5.6 | 73 +++++++++ .circleci/images/primary/Dockerfile-2.6.4 | 73 +++++++++ Appraisals | 172 +++++++++++++++++++++- Rakefile | 126 +++++++++++++++- docker-compose.yml | 60 ++++++++ docs/GettingStarted.md | 3 + 7 files changed, 658 insertions(+), 8 deletions(-) create mode 100644 .circleci/images/primary/Dockerfile-2.5.6 create mode 100644 .circleci/images/primary/Dockerfile-2.6.4 diff --git a/.circleci/config.yml b/.circleci/config.yml index 7beaddee355..248ae12cf1c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,6 +24,14 @@ ruby_containers: &ruby_containers image: palazzem/docker-library:ddtrace_rb_2_4_6 environment: - BUNDLE_GEMFILE=/app/Gemfile + - &container-2_5 + image: marcotc/docker-library:ddtrace_rb_2_5_6 + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - &container-2_6 + image: marcotc/docker-library:ddtrace_rb_2_6_4 + environment: + - BUNDLE_GEMFILE=/app/Gemfile test_containers: &test_containers - &container_postgres @@ -399,10 +407,125 @@ jobs: keys: - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.4-{{ checksum ".circleci/bundle_checksum" }}' - *step_run_all_tests + + checkout-2.5: + <<: *job_defaults + docker: + - *container-2_5 + steps: + - checkout + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}' + paths: + - /app + build-2.5: + <<: *job_defaults + docker: + - *container-2_5 + steps: + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}' + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}' + - *step_init_bundle_checksum + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}' + - *step_bundle_install + - *step_rubocop + - *step_appraisal_install + - *step_compute_bundle_checksum + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}' + paths: + - /app + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}' + paths: + - /usr/local/bundle + test-2.5: + <<: *job_defaults + docker: + - <<: *container-2_5 + environment: + - TEST_DATADOG_INTEGRATION: 1 + - *container_postgres + - *container_mysql + - *container_elasticsearch + - *container_redis + - *container_mongo + - *container_memcached + - *container_agent + steps: + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.5-{{ .Environment.CIRCLE_SHA1 }}' + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.5-{{ checksum ".circleci/bundle_checksum" }}' + - *step_run_all_tests + + checkout-2.6: + <<: *job_defaults + docker: + - *container-2_6 + steps: + - checkout + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}' + paths: + - /app + build-2.6: + <<: *job_defaults + docker: + - *container-2_6 + steps: + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}' + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}' + - *step_init_bundle_checksum + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}' + - *step_bundle_install + - *step_rubocop + - *step_appraisal_install + - *step_compute_bundle_checksum + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}' + paths: + - /app + - save_cache: + key: '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}' + paths: + - /usr/local/bundle + test-2.6: + <<: *job_defaults + docker: + - <<: *container-2_6 + environment: + - TEST_DATADOG_INTEGRATION: 1 + - *container_postgres + - *container_mysql + - *container_elasticsearch + - *container_redis + - *container_mongo + - *container_memcached + - *container_agent + steps: + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-2.6-{{ .Environment.CIRCLE_SHA1 }}' + - restore_cache: + keys: + - '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundle-2.6-{{ checksum ".circleci/bundle_checksum" }}' + - *step_run_all_tests + "deploy release": <<: *job_defaults docker: - - *container-2_4 + - *container-2_5 steps: - checkout - run: @@ -420,7 +543,7 @@ jobs: "deploy prerelease Gem": <<: *job_defaults docker: - - *container-2_4 + - *container-2_5 steps: - checkout - run: @@ -431,10 +554,10 @@ jobs: - run: name: Rename to pre-release version based on branch name and build number command: | - # create safe version string - PRE=$(echo "${CIRCLE_BRANCH:-unknown}.${CIRCLE_BUILD_NUM:-R$RANDOM}" | sed -e 's/[^a-zA-Z0-9+]\{1,\}/./g') - echo PRE=$PRE - sed lib/ddtrace/version.rb -i -e "s/^\([\t ]*PRE\) *=*/\1 = \'${PRE}\' #/g" + # create safe version string + PRE=$(echo "${CIRCLE_BRANCH:-unknown}.${CIRCLE_BUILD_NUM:-R$RANDOM}" | sed -e 's/[^a-zA-Z0-9+]\{1,\}/./g') + echo PRE=$PRE + sed lib/ddtrace/version.rb -i -e "s/^\([\t ]*PRE\) *=*/\1 = \'${PRE}\' #/g" - run: name: Upload prereleas Gem and rebuild index command: S3_DIR=prerelease bundle exec rake release:gem @@ -500,6 +623,26 @@ workflows: <<: *filters_all_branches_and_tags requires: - build-2.4 + - checkout-2.5: + <<: *filters_all_branches_and_tags + - build-2.5: + <<: *filters_all_branches_and_tags + requires: + - checkout-2.5 + - test-2.5: + <<: *filters_all_branches_and_tags + requires: + - build-2.5 + - checkout-2.6: + <<: *filters_all_branches_and_tags + - build-2.6: + <<: *filters_all_branches_and_tags + requires: + - checkout-2.6 + - test-2.6: + <<: *filters_all_branches_and_tags + requires: + - build-2.6 - "deploy prerelease Gem": <<: *filters_all_branches_and_tags requires: @@ -508,6 +651,8 @@ workflows: - test-2.2 - test-2.3 - test-2.4 + - test-2.5 + - test-2.6 - "deploy release": <<: *filters_only_release_tags requires: @@ -516,3 +661,5 @@ workflows: - test-2.2 - test-2.3 - test-2.4 + - test-2.5 + - test-2.6 diff --git a/.circleci/images/primary/Dockerfile-2.5.6 b/.circleci/images/primary/Dockerfile-2.5.6 new file mode 100644 index 00000000000..1ca94963a99 --- /dev/null +++ b/.circleci/images/primary/Dockerfile-2.5.6 @@ -0,0 +1,73 @@ +# Current version: https://github.com/docker-library/ruby/blob/6a7df7a72b4a3d1b3e06ead303841b3fdaca560e/2.5/buster/Dockerfile +FROM ruby:2.5.6 + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install jq +RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \ + && chmod +x /usr/bin/jq \ + && jq --version + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \ + && echo Docker URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \ + && tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \ + && rm -rf /tmp/dockerize-linux-amd64.tar.gz \ + && dockerize --version + +# Install RubyGems +RUN gem update --system +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems +RUN gem update --system +RUN gem install bundler +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/.circleci/images/primary/Dockerfile-2.6.4 b/.circleci/images/primary/Dockerfile-2.6.4 new file mode 100644 index 00000000000..2318784fce8 --- /dev/null +++ b/.circleci/images/primary/Dockerfile-2.6.4 @@ -0,0 +1,73 @@ +# Current version: https://github.com/docker-library/ruby/blob/6a7df7a72b4a3d1b3e06ead303841b3fdaca560e/2.6/buster/Dockerfile +FROM ruby:2.6.4 + +# Make apt non-interactive +RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90circleci \ + && echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90circleci + +ENV DEBIAN_FRONTEND=noninteractive + +# Install required packages +RUN set -ex; \ + apt-get update; \ + mkdir -p /usr/share/man/man1; \ + apt-get install -y --no-install-recommends \ + git mercurial xvfb \ + locales sudo openssh-client ca-certificates tar gzip parallel \ + net-tools netcat unzip zip bzip2 gnupg curl wget \ + tzdata rsync vim; \ + rm -rf /var/lib/apt/lists/*; + +# Set timezone to UTC by default +RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime + +# Set language +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en + +# Install jq +RUN JQ_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/jq-latest" \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/jq $JQ_URL \ + && chmod +x /usr/bin/jq \ + && jq --version + +# Install Docker +RUN set -ex \ + && export DOCKER_VERSION=$(curl --silent --fail --retry 3 https://download.docker.com/linux/static/stable/x86_64/ | grep -o -e 'docker-[.0-9]*-ce\.tgz' | sort -r | head -n 1) \ + && DOCKER_URL="https://download.docker.com/linux/static/stable/x86_64/${DOCKER_VERSION}" \ + && echo Docker URL: $DOCKER_URL \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/docker.tgz "${DOCKER_URL}" \ + && ls -lha /tmp/docker.tgz \ + && tar -xz -C /tmp -f /tmp/docker.tgz \ + && mv /tmp/docker/* /usr/bin \ + && rm -rf /tmp/docker /tmp/docker.tgz \ + && which docker \ + && (docker version || true) + +# Install Docker Compose +RUN COMPOSE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/docker-compose-latest" \ + && curl --silent --show-error --location --fail --retry 3 --output /usr/bin/docker-compose $COMPOSE_URL \ + && chmod +x /usr/bin/docker-compose \ + && docker-compose version + +# Install Dockerize +RUN DOCKERIZE_URL="https://circle-downloads.s3.amazonaws.com/circleci-images/cache/linux-amd64/dockerize-latest.tar.gz" \ + && curl --silent --show-error --location --fail --retry 3 --output /tmp/dockerize-linux-amd64.tar.gz $DOCKERIZE_URL \ + && tar -C /usr/local/bin -xzvf /tmp/dockerize-linux-amd64.tar.gz \ + && rm -rf /tmp/dockerize-linux-amd64.tar.gz \ + && dockerize --version + +# Install RubyGems +RUN gem update --system +RUN mkdir -p "$GEM_HOME" && chmod -R 777 "$GEM_HOME" + +# Install RubyGems +RUN gem update --system +RUN gem install bundler +ENV BUNDLE_SILENCE_ROOT_WARNING 1 + +RUN mkdir /app +WORKDIR /app + +CMD ["/bin/sh"] diff --git a/Appraisals b/Appraisals index 6b818bf639c..906a8114f21 100644 --- a/Appraisals +++ b/Appraisals @@ -493,8 +493,177 @@ elsif Gem::Version.new('2.3.0') <= Gem::Version.new(RUBY_VERSION) \ gem 'typhoeus' end end -elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) +elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) \ + && Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5.0') if RUBY_PLATFORM != 'java' + appraise 'rails5-mysql2' do + gem 'rails', '~> 5.2.1' + gem 'mysql2', '< 0.5', platform: :ruby + end + + appraise 'rails5-postgres' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + end + + appraise 'rails5-postgres-redis' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-redis-activesupport' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-sidekiq' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'sidekiq' + gem 'activejob' + end + + appraise 'contrib' do + gem 'actionpack' + gem 'actionview' + gem 'active_model_serializers', '>= 0.10.0' + gem 'activerecord', '< 5.1.5' + gem 'aws-sdk' + gem 'concurrent-ruby' + gem 'dalli' + gem 'delayed_job' + gem 'delayed_job_active_record' + gem 'elasticsearch-transport' + gem 'ethon' + gem 'excon' + gem 'grape' + gem 'graphql' + gem 'grpc' + gem 'hiredis' + gem 'mongo', '>= 2.8.0' + gem 'mysql2', '< 0.5', platform: :ruby + gem 'racecar', '>= 0.3.5' + gem 'rack' + gem 'rack-test' + gem 'rake', '>= 12.3' + gem 'redis', '< 4.0' + gem 'rest-client' + gem 'resque', '< 2.0' + gem 'sequel' + gem 'shoryuken' + gem 'sidekiq' + gem 'sinatra' + gem 'sqlite3', '~> 1.3.6' + gem 'sucker_punch' + gem 'typhoeus' + end + end +elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \ + && Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0') + if RUBY_PLATFORM != 'java' + appraise 'rails5-mysql2' do + gem 'rails', '~> 5.2.1' + gem 'mysql2', '< 0.5', platform: :ruby + end + + appraise 'rails5-postgres' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + end + + appraise 'rails5-postgres-redis' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-redis-activesupport' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-sidekiq' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'sidekiq' + gem 'activejob' + end + + appraise 'contrib' do + gem 'actionpack' + gem 'actionview' + gem 'active_model_serializers', '>= 0.10.0' + gem 'activerecord', '< 5.1.5' + gem 'aws-sdk' + gem 'concurrent-ruby' + gem 'dalli' + gem 'delayed_job' + gem 'delayed_job_active_record' + gem 'elasticsearch-transport' + gem 'ethon' + gem 'excon' + gem 'grape' + gem 'graphql' + gem 'grpc' + gem 'hiredis' + gem 'mongo', '>= 2.8.0' + gem 'mysql2', '< 0.5', platform: :ruby + gem 'racecar', '>= 0.3.5' + gem 'rack' + gem 'rack-test' + gem 'rake', '>= 12.3' + gem 'redis', '< 4.0' + gem 'rest-client' + gem 'resque', '< 2.0' + gem 'sequel' + gem 'shoryuken' + gem 'sidekiq' + gem 'sinatra' + gem 'sqlite3', '~> 1.3.6' + gem 'sucker_punch' + gem 'typhoeus' + end + end +elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) + if RUBY_PLATFORM != 'java' + appraise 'rails5-mysql2' do + gem 'rails', '~> 5.2.1' + gem 'mysql2', '< 0.5', platform: :ruby + end + + appraise 'rails5-postgres' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + end + + appraise 'rails5-postgres-redis' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-redis-activesupport' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'redis-rails' + gem 'redis' + end + + appraise 'rails5-postgres-sidekiq' do + gem 'rails', '~> 5.2.1' + gem 'pg', '< 1.0', platform: :ruby + gem 'sidekiq' + gem 'activejob' + end + appraise 'contrib' do gem 'actionpack' gem 'actionview' @@ -531,3 +700,4 @@ elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) end end end + diff --git a/Rakefile b/Rakefile index 211418fa24a..d45a9e0121f 100644 --- a/Rakefile +++ b/Rakefile @@ -444,7 +444,8 @@ task :ci do sh 'bundle exec appraisal rails5-mysql2 rake spec:rails' sh 'bundle exec appraisal rails5-postgres rake spec:rails' end - elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) + elsif Gem::Version.new('2.4.0') <= Gem::Version.new(RUBY_VERSION) \ + && Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5.0') # Main library sh 'bundle exec rake test:main' sh 'bundle exec rake spec:main' @@ -452,6 +453,8 @@ task :ci do sh 'bundle exec rake spec:opentracer' if RUBY_PLATFORM != 'java' + # Benchmarks + sh 'bundle exec rake benchmark' # Contrib minitests sh 'bundle exec appraisal contrib rake test:grape' sh 'bundle exec appraisal contrib rake test:sidekiq' @@ -485,7 +488,128 @@ task :ci do sh 'bundle exec appraisal contrib rake spec:sinatra' sh 'bundle exec appraisal contrib rake spec:ethon' # Rails minitests + # We only test Rails 5+ because older versions require Bundler < 2.0 + sh 'bundle exec appraisal rails5-mysql2 rake test:rails' + sh 'bundle exec appraisal rails5-postgres rake test:rails' + sh 'bundle exec appraisal rails5-postgres-redis rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-redis-activesupport rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railssidekiq' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railsactivejob' + sh 'bundle exec appraisal rails5-postgres rake test:railsdisableenv' + # Rails specs + sh 'bundle exec appraisal rails5-mysql2 rake spec:rails' + sh 'bundle exec appraisal rails5-postgres rake spec:rails' + end + elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \ + && Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6.0') + # Main library + sh 'bundle exec rake test:main' + sh 'bundle exec rake spec:main' + sh 'bundle exec rake spec:contrib' + sh 'bundle exec rake spec:opentracer' + + if RUBY_PLATFORM != 'java' + # Benchmarks + sh 'bundle exec rake benchmark' + # Contrib minitests + sh 'bundle exec appraisal contrib rake test:grape' + sh 'bundle exec appraisal contrib rake test:sidekiq' + sh 'bundle exec appraisal contrib rake test:sucker_punch' + # Contrib specs + sh 'bundle exec appraisal contrib rake spec:action_pack' + sh 'bundle exec appraisal contrib rake spec:action_view' + sh 'bundle exec appraisal contrib rake spec:active_model_serializers' + sh 'bundle exec appraisal contrib rake spec:active_record' + sh 'bundle exec appraisal contrib rake spec:active_support' + sh 'bundle exec appraisal contrib rake spec:aws' + sh 'bundle exec appraisal contrib rake spec:concurrent_ruby' + sh 'bundle exec appraisal contrib rake spec:dalli' + sh 'bundle exec appraisal contrib rake spec:delayed_job' + sh 'bundle exec appraisal contrib rake spec:elasticsearch' + sh 'bundle exec appraisal contrib rake spec:excon' + sh 'bundle exec appraisal contrib rake spec:faraday' + sh 'bundle exec appraisal contrib rake spec:graphql' + sh 'bundle exec appraisal contrib rake spec:grpc' + sh 'bundle exec appraisal contrib rake spec:http' + sh 'bundle exec appraisal contrib rake spec:mongodb' + sh 'bundle exec appraisal contrib rake spec:mysql2' + sh 'bundle exec appraisal contrib rake spec:racecar' + sh 'bundle exec appraisal contrib rake spec:rack' + sh 'bundle exec appraisal contrib rake spec:rake' + sh 'bundle exec appraisal contrib rake spec:redis' + sh 'bundle exec appraisal contrib rake spec:resque' + sh 'bundle exec appraisal contrib rake spec:rest_client' + sh 'bundle exec appraisal contrib rake spec:sequel' + sh 'bundle exec appraisal contrib rake spec:shoryuken' + sh 'bundle exec appraisal contrib rake spec:sinatra' + sh 'bundle exec appraisal contrib rake spec:ethon' + # Rails minitests + # We only test Rails 5+ because older versions require Bundler < 2.0 + sh 'bundle exec appraisal rails5-mysql2 rake test:rails' + sh 'bundle exec appraisal rails5-postgres rake test:rails' + sh 'bundle exec appraisal rails5-postgres-redis rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-redis-activesupport rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railssidekiq' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railsactivejob' + sh 'bundle exec appraisal rails5-postgres rake test:railsdisableenv' + # Rails specs + sh 'bundle exec appraisal rails5-mysql2 rake spec:rails' + sh 'bundle exec appraisal rails5-postgres rake spec:rails' + end + elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION) + # Main library + sh 'bundle exec rake test:main' + sh 'bundle exec rake spec:main' + sh 'bundle exec rake spec:contrib' + sh 'bundle exec rake spec:opentracer' + + if RUBY_PLATFORM != 'java' + # Benchmarks sh 'bundle exec rake benchmark' + # Contrib minitests + sh 'bundle exec appraisal contrib rake test:grape' + sh 'bundle exec appraisal contrib rake test:sidekiq' + sh 'bundle exec appraisal contrib rake test:sucker_punch' + # Contrib specs + sh 'bundle exec appraisal contrib rake spec:action_pack' + sh 'bundle exec appraisal contrib rake spec:action_view' + sh 'bundle exec appraisal contrib rake spec:active_model_serializers' + sh 'bundle exec appraisal contrib rake spec:active_record' + sh 'bundle exec appraisal contrib rake spec:active_support' + sh 'bundle exec appraisal contrib rake spec:aws' + sh 'bundle exec appraisal contrib rake spec:concurrent_ruby' + sh 'bundle exec appraisal contrib rake spec:dalli' + sh 'bundle exec appraisal contrib rake spec:delayed_job' + sh 'bundle exec appraisal contrib rake spec:elasticsearch' + sh 'bundle exec appraisal contrib rake spec:excon' + sh 'bundle exec appraisal contrib rake spec:faraday' + sh 'bundle exec appraisal contrib rake spec:graphql' + sh 'bundle exec appraisal contrib rake spec:grpc' + sh 'bundle exec appraisal contrib rake spec:http' + sh 'bundle exec appraisal contrib rake spec:mongodb' + sh 'bundle exec appraisal contrib rake spec:mysql2' + sh 'bundle exec appraisal contrib rake spec:racecar' + sh 'bundle exec appraisal contrib rake spec:rack' + sh 'bundle exec appraisal contrib rake spec:rake' + sh 'bundle exec appraisal contrib rake spec:redis' + sh 'bundle exec appraisal contrib rake spec:resque' + sh 'bundle exec appraisal contrib rake spec:rest_client' + sh 'bundle exec appraisal contrib rake spec:sequel' + sh 'bundle exec appraisal contrib rake spec:shoryuken' + sh 'bundle exec appraisal contrib rake spec:sinatra' + sh 'bundle exec appraisal contrib rake spec:ethon' + # Rails minitests + # We only test Rails 5+ because older versions require Bundler < 2.0 + sh 'bundle exec appraisal rails5-mysql2 rake test:rails' + sh 'bundle exec appraisal rails5-postgres rake test:rails' + sh 'bundle exec appraisal rails5-postgres-redis rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-redis-activesupport rake test:railsredis' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railssidekiq' + sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railsactivejob' + sh 'bundle exec appraisal rails5-postgres rake test:railsdisableenv' + # Rails specs + sh 'bundle exec appraisal rails5-mysql2 rake spec:rails' + sh 'bundle exec appraisal rails5-postgres rake spec:rails' end end end diff --git a/docker-compose.yml b/docker-compose.yml index 8a2071b9079..0de238c75e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -140,6 +140,62 @@ services: - .:/app - bundle-2.4:/usr/local/bundle - gemfiles-2.4:/app/gemfiles + tracer-2.5: + image: marcotc/docker-library:ddtrace_rb_2_5_6 + command: /bin/bash + depends_on: + - ddagent + - elasticsearch + - memcached + - mongodb + - mysql + - postgres + - redis + env_file: ./.env + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - TEST_DATADOG_INTEGRATION=1 + - TEST_ELASTICSEARCH_HOST=elasticsearch + - TEST_MEMCACHED_HOST=memcached + - TEST_MONGODB_HOST=mongodb + - TEST_MYSQL_HOST=mysql + - TEST_POSTGRES_HOST=postgres + - TEST_REDIS_HOST=redis + stdin_open: true + tty: true + volumes: + - .:/app + - bundle-2.5:/usr/local/bundle + - gemfiles-2.5:/app/gemfiles + tracer-2.6: + image: marcotc/docker-library:ddtrace_rb_2_6_4 + command: /bin/bash + depends_on: + - ddagent + - elasticsearch + - memcached + - mongodb + - mysql + - postgres + - redis + env_file: ./.env + environment: + - BUNDLE_GEMFILE=/app/Gemfile + - DD_AGENT_HOST=ddagent + - TEST_DATADOG_INTEGRATION=1 + - TEST_ELASTICSEARCH_HOST=elasticsearch + - TEST_MEMCACHED_HOST=memcached + - TEST_MONGODB_HOST=mongodb + - TEST_MYSQL_HOST=mysql + - TEST_POSTGRES_HOST=postgres + - TEST_REDIS_HOST=redis + stdin_open: true + tty: true + volumes: + - .:/app + - bundle-2.6:/usr/local/bundle + - gemfiles-2.6:/app/gemfiles ddagent: image: datadog/docker-dd-agent environment: @@ -209,8 +265,12 @@ volumes: bundle-2.2: bundle-2.3: bundle-2.4: + bundle-2.5: + bundle-2.6: gemfiles-2.0: gemfiles-2.1: gemfiles-2.2: gemfiles-2.3: gemfiles-2.4: + gemfiles-2.5: + gemfiles-2.6: diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index ea951946777..89f619bf796 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -87,6 +87,8 @@ To contribute, check out the [contribution guidelines][contribution docs] and [d | | | 2.2 | Full | Latest | TBD | | | | 2.3 | Full | Latest | TBD | | | | 2.4 | Full | Latest | TBD | +| | | 2.5 | Full | Latest | TBD | +| | | 2.6 | Full | Latest | TBD | | JRuby | http://jruby.org/ | 9.1.5 | Experimental | Latest | TBD | **Supported web servers**: @@ -1104,6 +1106,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | 2.1 | 3.0 - 4.2 | | 2.2 - 2.3 | 3.0 - 5.2 | | 2.4 - 2.5 | 4.2.8 - 5.2 | +| 2.6 | 5.0 - 5.2 | ### Rake