<commit_before># Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import logging
import os
import re
import sys

from layout_package import path_utils
from layout_package import test_failures

sys.path.append(path_utils.PathFromBase('third_party'))
import simplejson

class JSONResultsGenerator:

  MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG = 100
  # Min time (seconds) that will be added to the JSON.
  MIN_TIME = 1
  JSON_PREFIX = "ADD_RESULTS("
  JSON_SUFFIX = ");"
  WEBKIT_PATH = "WebKit"
  LAYOUT_TESTS_PATH = "layout_tests"
  PASS_RESULT = "P"
  NO_DATA_RESULT = "N"

  def __init__(self, failures, individual_test_timings, builder_name,
      build_number, results_file_path, all_tests):
    """
    failures: Map of test name to list of failures.
    individual_test_times: Map of test name to a tuple containing the<commit_msg>Double the number of runs we track in the flakiness dashboard. 100 doesn't seem to be enough for some of the tests that only flake 1/100 runs to see if they also flake on other platforms or build types.<commit_after># Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import logging
import os
import re
import sys

from layout_package import path_utils
from layout_package import test_failures

sys.path.append(path_utils.PathFromBase('third_party'))
import simplejson

class JSONResultsGenerator:

  MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG = 200
  # Min time (seconds) that will be added to the JSON.
  MIN_TIME = 1
  JSON_PREFIX = "ADD_RESULTS("
  JSON_SUFFIX = ");"
  WEBKIT_PATH = "WebKit"
  LAYOUT_TESTS_PATH = "layout_tests"
  PASS_RESULT = "P"
  NO_DATA_RESULT = "N"

  def __init__(self, failures, individual_test_timings, builder_name,
      build_number, results_file_path, all_tests):
    """
    failures: Map of test name to list of failures.
    individual_test_times: Map of test name to a tuple containing the
{'fraction_non_alphanumeric': 0.06343104276790004, 'fraction_numerical': 0.011052378664103796, 'mean_word_length': 4.537234042553192, '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': '418355', 'n_tokens_mistral': 669, 'n_tokens_neox': 630, 'n_words': 241}