<commit_before>require 'ci/common'

def oracle_version
  ENV['FLAVOR_VERSION'] || 'latest'
end

def oracle_repo
  'sath89/oracle-12c'
end

def oracle_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/oracle_#{oracle_version}"
end

def oracle_volume
  "#{ENV['ORACLE_DIR']}/data"
end

container_name = 'dd-test-oracle'
container_port = 1_521
container_port_8080 = 80_80

namespace :ci do
  namespace :oracle do |flavor|
    task before_install: ['ci:common:before_install'] do
      sh %(pip install pexpect==4.2.1)
      sh %(mkdir -p #{ENV['ORACLE_DIR']})
      sh %(#{ENV['TRAVIS_BUILD_DIR']}/oracle/ci/resources/get_instantclient.py --agree=yes)
      sh %(echo #{ENV['ORACLE_HOME']} | sudo tee /etc/ld.so.conf.d/oracle_instantclient.conf)
      sh %(sudo ldconfig)
      unless File.exist?("#{ENV['ORACLE_HOME']}/libclntsh.so")
        sh %(ln -s #{ENV['ORACLE_HOME']}/libclntsh.so.12.1 #{ENV['ORACLE_HOME']}/libclntsh.so)
      end
      `docker kill $(docker ps -q --filter name=#{container_name}) || true`
      `docker rm $(docker ps -aq --filter name=#{container_name}) || true`
    end

    task install: ['ci:common:install'] do
      use_venv = in_venv<commit_msg>[oracle][ci] no more pexpect required.<commit_after>require 'ci/common'

def oracle_version
  ENV['FLAVOR_VERSION'] || 'latest'
end

def oracle_repo
  'sath89/oracle-12c'
end

def oracle_rootdir
  "#{ENV['INTEGRATIONS_DIR']}/oracle_#{oracle_version}"
end

def oracle_volume
  "#{ENV['ORACLE_DIR']}/data"
end

container_name = 'dd-test-oracle'
container_port = 1_521
container_port_8080 = 80_80

namespace :ci do
  namespace :oracle do |flavor|
    task before_install: ['ci:common:before_install'] do
      sh %(mkdir -p #{ENV['ORACLE_DIR']})
      sh %(#{ENV['TRAVIS_BUILD_DIR']}/oracle/ci/resources/get_instantclient.py --agree=yes)
      sh %(echo #{ENV['ORACLE_HOME']} | sudo tee /etc/ld.so.conf.d/oracle_instantclient.conf)
      sh %(sudo ldconfig)
      unless File.exist?("#{ENV['ORACLE_HOME']}/libclntsh.so")
        sh %(ln -s #{ENV['ORACLE_HOME']}/libclntsh.so.12.1 #{ENV['ORACLE_HOME']}/libclntsh.so)
      end
      `docker kill $(docker ps -q --filter name=#{container_name}) || true`
      `docker rm $(docker ps -aq --filter name=#{container_name}) || true`
    end

    task install: ['ci:common:install'] do
      use_venv = in_venv
{'fraction_non_alphanumeric': 0.16421780466724287, 'fraction_numerical': 0.017718236819360415, 'mean_word_length': 4.076754385964913, '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': '1963112', 'n_tokens_mistral': 934, 'n_tokens_neox': 860, 'n_words': 173}