Exemplo n.º 1
0
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from datetime import date
from datetime import timedelta
import os
import sys

_ROOT_DIR = os.path.realpath(
    os.path.join(os.path.dirname(__file__), os.path.pardir))
_FIRST_PARTY_DIR = os.path.join(_ROOT_DIR, 'first_party')
sys.path.insert(1, _FIRST_PARTY_DIR)

from local_libs import script_util

script_util.SetUpSystemPaths(_ROOT_DIR)

from analysis.type_enums import CrashClient
from app.common.model.clusterfuzz_analysis import ClusterfuzzAnalysis
from app.common.model.cracas_crash_analysis import CracasCrashAnalysis
from app.common.model.fracas_crash_analysis import FracasCrashAnalysis
from app.common.model.uma_sampling_profiler_analysis import (
    UMASamplingProfilerAnalysis)
from libs.cache_decorator import GeneratorCached
from local_libs import local_iterator
from local_libs.local_cache import LocalCache

_DEFAULT_BATCH_SIZE = 1000
_TODAY = date.today().strftime('%Y-%m-%d')
_A_YEAR_AGO = (date.today() - timedelta(days=365)).strftime('%Y-%m-%d')
_CLIENT_ID_TO_CLASS = {
Exemplo n.º 2
0
# Copyright 2014 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.

from datetime import datetime
from datetime import timedelta
import os
import sys
import textwrap
import unittest

_ROOT_DIR = os.path.join(
    os.path.dirname(__file__), os.path.pardir, os.path.pardir)
sys.path.insert(1, _ROOT_DIR)
from local_libs import script_util
script_util.SetUpSystemPaths()

from libs.gitiles.blame import Blame
from libs.gitiles.blame import Region
from libs.gitiles import change_log
from local_libs.git_checkout import local_git_parsers


class LocalGitParsersTest(unittest.TestCase):

  def setUp(self):
    super(LocalGitParsersTest, self).setUp()
    self.blame_parser = local_git_parsers.GitBlameParser()

  def testGitBlameParser(self):
    output = textwrap.dedent("""