<commit_before># (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)

require './ci/common'

def redis_version
  ENV['FLAVOR_VERSION'] || '2.8.19'
end

def redis_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/redis_#{redis_version}"
end

namespace :ci do
  namespace :redis do |flavor|
    task before_install: ['ci:common:before_install']

    task install: ['ci:common:install'] do
      # Downloads
      # https://github.com/antirez/redis/archive/#{redis_version}.zip
      unless Dir.exist? File.expand_path(redis_rootdir)
        sh %(curl -s -L\
             -o $VOLATILE_DIR/redis.zip\
             https://s3.amazonaws.com/dd-agent-tarball-mirror/redis-#{redis_version}.zip)
        sh %(mkdir -p #{redis_rootdir})
        sh %(mkdir -p $VOLATILE_DIR/redis)
        sh %(unzip -x $VOLATILE_DIR/redis.zip -d $VOLATILE_DIR/)
        sh %(mv -f $VOLATILE_DIR/redis-*/* #{redis_rootdir})
        sh %(cd #{redis_rootdir} && make -j $CONCURRENCY)
      end
    end

    task before_script: ['ci:common:before_script'] do
      # Run redis !
      sh %(#{redis_rootdir}/src/redis-server\
           $TRAVIS_BUILD_DIR/ci/resources/redis/auth.conf)
      sh %(#{redis_rootdir}/src/redis-server\
           $TRAVIS_BUILD_DIR/ci/resources/redis/noauth.conf)
      sh %(#{redis_rootdir}/src/redis-server\
           $TRAVIS_BUILD_DIR/ci/resources/redis/slave_healthy.conf)
      sh %(#{redis_rootdir}/src/redis-server\
           $TRAVIS_BUILD_DIR/ci/resources/redis/slave_unhealthy.conf)
    end

    task script: ['ci:common:script'] do
      this_provides = [
        'redis'
      ]
      Rake::Task['ci:common:run_tests'].invoke(this_provides)
    end

    task before_cache: ['ci:common:before_cache']
<commit_msg>handle dirty states from redis install (#2912)<commit_after># (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)

require './ci/common'

def redis_version
  ENV['FLAVOR_VERSION'] || '2.8.19'
end

def redis_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/redis_#{redis_version}"
end

def redis_bin
  "#{redis_rootdir}/src/redis-server"
end

namespace :ci do
  namespace :redis do |flavor|
    task before_install: ['ci:common:before_install']

    task install: ['ci:common:install'] do
      # Downloads
      # https://github.com/antirez/redis/archive/#{redis_version}.zip
      unless File.exist? redis_bin
        sh %(curl -s -S -L\
             -o $VOLATILE_DIR/redis.zip\
             https://s3.amazonaws.com/dd-agent-tarball-mirror/redis-#{redis_version}.zip)
        sh %(rm -rf #{redis_rootdir} && mkdir -p #{redis_rootdir})
        sh %(mkdir -p $VOLATILE_DIR/redis)
        sh %(unzip -x $VOLATILE_DIR/redis.zip -d $VOLATILE_DIR/)
        sh %(mv -f $VOLATILE_DIR/redis-*/* #{redis_rootdir})
        sh %(cd #{redis_rootdir} && make -j $CONCURRENCY)
      end
    end

    task before_script: ['ci:common:before_script'] do
      # Run redis !
      sh %(#{redis_bin} $TRAVIS_BUILD_DIR/ci/resources/redis/auth.conf)
      sh %(#{redis_bin} $TRAVIS_BUILD_DIR/ci/resources/redis/noauth.conf)
      sh %(#{redis_bin} $TRAVIS_BUILD_DIR/ci/resources/redis/slave_healthy.conf)
      sh %(#{redis_bin} $TRAVIS_BUILD_DIR/ci/resources/redis/slave_unhealthy.conf)
    end

    task script: ['ci:common:script'] do
      this_provides = [
        'redis'
      ]
      Rake::Task['ci:common:run_tests'].invoke(this_provides)
    end

    task before_cache: ['ci:common:before_cache']

{'fraction_non_alphanumeric': 0.14474061335626254, 'fraction_numerical': 0.008598452278589854, 'mean_word_length': 3.0440324449594436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1813927', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1302, 'n_words': 232}