示例#1
0
  def test_print_log_stats(self):
    self.mock(cq_stats, 'output', self.print_mock)
    args = Args(use_logs=True)
    stats_set = cq_stats.default_stats()
    stats_set['begin'] = args.date
    stats_set['end'] = args.date + datetime.timedelta(days=7)

    cq_stats.print_stats(args, stats_set)
    return self.expectations
示例#2
0
    def test_print_log_stats(self):
        self.mock(cq_stats, 'output', self.print_mock)
        args = Args(use_logs=True)
        stats_set = cq_stats.default_stats()
        stats_set['begin'] = args.date
        stats_set['end'] = args.date + datetime.timedelta(days=7)

        cq_stats.print_stats(args, stats_set)
        return self.expectations
示例#3
0
  def test_print_stats(self):
    self.mock(cq_stats, 'output', self.print_mock)
    args = Args()
    stats_set = cq_stats.default_stats()
    stats_set['begin'] = args.date
    stats_set['end'] = args.date + datetime.timedelta(days=7)

    stats_set['patch_stats'].update({
        (123, 1): {
            'attempts': 1,
            'false-rejections': 0,
            'rejections': 1,
            'committed': False,
            'patchset-duration': 3600,
            'patchset-duration-wallclock': 3600,
            'failed-jobs-details': {
                'builder_a': 1,
            },
        },
        (456, 1): {
            'attempts': 1,
            'false-rejections': 0,
            'rejections': 1,
            'committed': False,
            'patchset-duration': 7200,
            'patchset-duration-wallclock': 7200,
            'failed-jobs-details': {
                'builder_a': 1,
            },
        },
    })

    swapped_stats = copy.deepcopy(stats_set)
    swapped_stats['begin'], swapped_stats['end'] = (
        swapped_stats['end'], swapped_stats['begin'])

    cq_stats.print_stats(args, None)
    cq_stats.print_stats(args, stats_set)
    cq_stats.print_stats(args, swapped_stats)

    stats_set['per-day'] = [
      copy.copy(stats_set),
      copy.copy(stats_set),
      copy.copy(stats_set),
    ]

    args = Args()
    args.path_filter_include = ['third_party/WebKit']
    cq_stats.print_stats(args, stats_set)

    args = Args()
    args.path_filter_exclude = ['third_party/WebKit']
    cq_stats.print_stats(args, stats_set)

    return self.expectations
示例#4
0
    def test_print_stats(self):
        self.mock(cq_stats, 'output', self.print_mock)
        args = Args()
        stats_set = cq_stats.default_stats()
        stats_set['begin'] = args.date
        stats_set['end'] = args.date + datetime.timedelta(days=7)

        stats_set['patch_stats'].update({
            (123, 1): {
                'attempts': 1,
                'false-rejections': 0,
                'rejections': 1,
                'committed': False,
                'patchset-duration': 3600,
                'patchset-duration-wallclock': 3600,
                'failed-jobs-details': {
                    'builder_a': 1,
                },
            },
            (456, 1): {
                'attempts': 1,
                'false-rejections': 0,
                'rejections': 1,
                'committed': False,
                'patchset-duration': 7200,
                'patchset-duration-wallclock': 7200,
                'failed-jobs-details': {
                    'builder_a': 1,
                },
            },
        })

        swapped_stats = copy.deepcopy(stats_set)
        swapped_stats['begin'], swapped_stats['end'] = (swapped_stats['end'],
                                                        swapped_stats['begin'])

        cq_stats.print_stats(args, None)
        cq_stats.print_stats(args, stats_set)
        cq_stats.print_stats(args, swapped_stats)
        return self.expectations
示例#5
0
    def test_print_stats(self):
        self.mock(cq_stats, "output", self.print_mock)
        args = Args()
        stats_set = cq_stats.default_stats()
        stats_set["begin"] = args.date
        stats_set["end"] = args.date + datetime.timedelta(days=7)

        stats_set["patch_stats"].update(
            {
                (123, 1): {
                    "attempts": 1,
                    "false-rejections": 0,
                    "rejections": 1,
                    "committed": False,
                    "patchset-duration": 3600,
                    "patchset-duration-wallclock": 3600,
                    "failed-jobs-details": {"builder_a": 1},
                },
                (456, 1): {
                    "attempts": 1,
                    "false-rejections": 0,
                    "rejections": 1,
                    "committed": False,
                    "patchset-duration": 7200,
                    "patchset-duration-wallclock": 7200,
                    "failed-jobs-details": {"builder_a": 1},
                },
            }
        )

        swapped_stats = copy.deepcopy(stats_set)
        swapped_stats["begin"], swapped_stats["end"] = (swapped_stats["end"], swapped_stats["begin"])

        cq_stats.print_stats(args, None)
        cq_stats.print_stats(args, stats_set)
        cq_stats.print_stats(args, swapped_stats)
        return self.expectations