<commit_before>require 'rspec/core/formatters/console_codes'

RSpec.configure do |config|
  if ENV['OS_IMAGE']
    config.before(:all) do
      @os_image_dir = Dir.mktmpdir('os-image-rspec')
      Bosh::Core::Shell.new.run("sudo tar xf #{ENV['OS_IMAGE']} -C #{@os_image_dir}")
      SpecInfra::Backend::Exec.instance.chroot_dir = @os_image_dir
    end

    config.after(:all) do
      FileUtils.rm_rf(@os_image_dir)
    end
  else
    warning = 'All OS_IMAGE tests are being skipped. ENV["OS_IMAGE"] must be set to test OS images'<commit_msg>Make cleanup of /tmp/os-image-rspec* work<commit_after>require 'rspec/core/formatters/console_codes'

RSpec.configure do |config|
  if ENV['OS_IMAGE']
    config.before(:all) do
      @os_image_dir = Dir.mktmpdir('os-image-rspec')
      Bosh::Core::Shell.new.run("sudo tar xf #{ENV['OS_IMAGE']} -C #{@os_image_dir}")
      SpecInfra::Backend::Exec.instance.chroot_dir = @os_image_dir
    end

    config.after(:all) do
      Bosh::Core::Shell.new.run("sudo rm -rf #{@os_image_dir}")
    end
  else
    warning = 'All OS_IMAGE tests are being skipped. ENV["OS_IMAGE"] must be set to test OS images'
{'fraction_non_alphanumeric': 0.14398595258999122, 'fraction_numerical': 0.0, 'mean_word_length': 3.9565217391304346, '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': '3816674', 'n_tokens_mistral': 419, 'n_tokens_neox': 416, 'n_words': 86}