<commit_before>ENV['FORCE_COLOR'] = 'true'
require 'aruba/api'
require 'aruba/cucumber'

# Monkey patch aruba to filter out some stuff
module Aruba::Api
  alias __all_stdout all_stdout
  
  def all_stdout
    unrandom(__all_stdout)
  end

  alias __all_stderr all_stderr
  def all_stderr
    err = __all_stderr
    if Cucumber::JRUBY
      # TODO: this actually a workaround for problems in cucumber and gherkin
      err = err.gsub(/^.*java_package_module_template.rb:\d+ warning: `eval' should not be aliased.*\n/, '')
      err = err.gsub(/^.*warning: singleton on non-persistent Java type Java::JavaUtil::ArrayList.*\n/, '')
    end
  end

  def unrandom(out)
    out = out.gsub(/#{Dir.pwd}\/tmp\/aruba/, '.') # Remove absolute paths
    out = out.gsub(/^\d+m\d+\.\d+s$/, '0m0.012s') # Make duration predictable
    out = out.gsub(/Coverage report generated for Cucumber Features to #{Dir.pwd}\/coverage.*\n$/, '') # Remove SimpleCov message
  end
end

Before do
  # Make sure bin/cucumber runs with SimpleCov enabled
  # set_env('SIMPLECOV', 'true')
  
  # Set a longer timeout for aruba
  @aruba_timeout_seconds = 15
end

After do
  terminate_background_jobs
end
<commit_msg>Explicitly return err from all_stderr()<commit_after>ENV['FORCE_COLOR'] = 'true'
require 'aruba/api'
require 'aruba/cucumber'

# Monkey patch aruba to filter out some stuff
module Aruba::Api
  alias __all_stdout all_stdout
  
  def all_stdout
    unrandom(__all_stdout)
  end

  alias __all_stderr all_stderr
  def all_stderr
    err = __all_stderr
    if Cucumber::JRUBY
      # TODO: this actually a workaround for problems in cucumber and gherkin
      err = err.gsub(/^.*java_package_module_template.rb:\d+ warning: `eval' should not be aliased.*\n/, '')
      err = err.gsub(/^.*warning: singleton on non-persistent Java type Java::JavaUtil::ArrayList.*\n/, '')
    end
    err
  end

  def unrandom(out)
    out = out.gsub(/#{Dir.pwd}\/tmp\/aruba/, '.') # Remove absolute paths
    out = out.gsub(/^\d+m\d+\.\d+s$/, '0m0.012s') # Make duration predictable
    out = out.gsub(/Coverage report generated for Cucumber Features to #{Dir.pwd}\/coverage.*\n$/, '') # Remove SimpleCov message
  end
end

Before do
  # Make sure bin/cucumber runs with SimpleCov enabled
  # set_env('SIMPLECOV', 'true')
  
  # Set a longer timeout for aruba
  @aruba_timeout_seconds = 15
end

After do
  terminate_background_jobs
end

{'fraction_non_alphanumeric': 0.12103505843071787, 'fraction_numerical': 0.005843071786310518, 'mean_word_length': 3.539772727272727, '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': '5074442', 'n_tokens_mistral': 847, 'n_tokens_neox': 822, 'n_words': 229}