<commit_before>require './ci/common'

def zk_version
  ENV['FLAVOR_VERSION'] || '3.4.6'
end

def zk_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/zk_#{zk_version}"
end

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

    task install: ['ci:common:install'] do
      unless Dir.exist? File.expand_path(zk_rootdir)
        sh %(curl -s -L\
             -o $VOLATILE_DIR/zookeeper-#{zk_version}.tar.gz\
             http://mirror.cogentco.com/pub/apache/zookeeper/zookeeper-#{zk_version}/zookeeper-#{zk_version}.tar.gz)
        sh %(mkdir -p #{zk_rootdir})
        sh %(tar zxf $VOLATILE_DIR/zookeeper-#{zk_version}.tar.gz\
             -C #{zk_rootdir} --strip-components=1)
      end
    end

    task before_script: ['ci:common:before_script'] do
      sh %(mkdir -p $VOLATILE_DIR/zookeeper)
      sh %(cp $TRAVIS_BUILD_DIR/ci/resources/zookeeper/zoo.cfg\
           #{zk_rootdir}/conf/)
      sh %(#{zk_rootdir}/bin/zkServer.sh start)
    end

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

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

    task cache: ['ci:common:cache']

    task cleanup: ['ci:common:cleanup'] do
      sh %(#{zk_rootdir}/bin/zkServer.sh stop)
    end

    task :execute do
      exception = nil<commit_msg>Update the mirror urls to use Apache archives so that the version we rely on doesn't go away each time a new release is cut.  Also start testing against 3.4.7, rather than 3.4.6.<commit_after>require './ci/common'

def zk_version
  ENV['FLAVOR_VERSION'] || '3.4.7'
end

def zk_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/zk_#{zk_version}"
end

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

    task install: ['ci:common:install'] do
      unless Dir.exist? File.expand_path(zk_rootdir)
        sh %(curl -s -L\
             -o $VOLATILE_DIR/zookeeper-#{zk_version}.tar.gz\
            http://archive.apache.org/dist/zookeeper/zookeeper-#{zk_version}/zookeeper-#{zk_version}.tar.gz)
        sh %(mkdir -p #{zk_rootdir})
        sh %(tar zxf $VOLATILE_DIR/zookeeper-#{zk_version}.tar.gz\
             -C #{zk_rootdir} --strip-components=1)
      end
    end

    task before_script: ['ci:common:before_script'] do
      sh %(mkdir -p $VOLATILE_DIR/zookeeper)
      sh %(cp $TRAVIS_BUILD_DIR/ci/resources/zookeeper/zoo.cfg\
           #{zk_rootdir}/conf/)
      sh %(#{zk_rootdir}/bin/zkServer.sh start)
    end

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

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

    task cache: ['ci:common:cache']

    task cleanup: ['ci:common:cleanup'] do
      sh %(#{zk_rootdir}/bin/zkServer.sh stop)
    end

    task :execute do
      exception = nil
{'fraction_non_alphanumeric': 0.14362960459614735, 'fraction_numerical': 0.004731328151402501, 'mean_word_length': 2.9257294429708223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1404471', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1067, 'n_words': 213}