<commit_before>require 'active_support/logger'
require 'models/college'
require 'models/course'

module ARTest
  def self.connection_name
    ENV['ARCONN'] || config['default_connection']
  end

  def self.connection_config
    config['connections'][connection_name]
  end

  def self.connect
    puts "Using #{connection_name}"
    file = File.open('debug.log', 'w')
    ActiveRecord::Model.logger = ActiveSupport::Logger.new(file)
    ActiveRecord::Model.configurations = connection_config
    ActiveRecord::Model.establish_connection 'arunit'
    ARUnit2Model.establish_connection 'arunit2'
  end
end<commit_msg>Revert "truncate debug.log on each test run"<commit_after>require 'active_support/logger'
require 'models/college'
require 'models/course'

module ARTest
  def self.connection_name
    ENV['ARCONN'] || config['default_connection']
  end

  def self.connection_config
    config['connections'][connection_name]
  end

  def self.connect
    puts "Using #{connection_name}"
    ActiveRecord::Model.logger = ActiveSupport::Logger.new("debug.log")
    ActiveRecord::Model.configurations = connection_config
    ActiveRecord::Model.establish_connection 'arunit'
    ARUnit2Model.establish_connection 'arunit2'
  end
end
{'fraction_non_alphanumeric': 0.10577705451586655, 'fraction_numerical': 0.0032546786004882017, 'mean_word_length': 5.3076923076923075, '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': '7645252', 'n_tokens_mistral': 372, 'n_tokens_neox': 362, 'n_words': 72}