<commit_before>module Healthcheck
  class S3
    def name
      :s3
    end

    def status
      connection = S3FileHandler.connection
      connection.directories.get(ENV["AWS_S3_BUCKET_NAME"])

      GovukHealthcheck::OK
    rescue StandardError
      GovukHealthcheck::CRITICAL
    end
  end
end<commit_msg>Skip S3 healthcheck if being run from E2E tests<commit_after>module Healthcheck
  class S3
    def name
      :s3
    end

    def status
      if ENV["SKIP_S3_HEALTHCHECK_FOR_PUBLISHING_E2E_TESTS"].blank?
        connection = S3FileHandler.connection
        connection.directories.get(ENV["AWS_S3_BUCKET_NAME"])
      end

      GovukHealthcheck::OK
    rescue StandardError
      GovukHealthcheck::CRITICAL
    end
  end
end
{'fraction_non_alphanumeric': 0.056910569105691054, 'fraction_numerical': 0.016260162601626018, 'mean_word_length': 2.9518716577540105, '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': '7019249', 'n_tokens_mistral': 248, 'n_tokens_neox': 244, 'n_words': 50}