Exemplo n.º 1
0
def test_get_error_detail_count(ptm):
    """Test get_error_detail_count method."""

    store_and_process_2_good_2_error_blobs(ptm)
    date_range = get_day_range(1)
    result = objectstore_refdata.get_error_detail_count(
        ptm.project,
        date_range["start"],
        date_range["stop"],
    )
    exp = {
        'four - Mozilla-Aurora - 14.0a2': 1,
        'one - Mozilla-Aurora - 14.0a2': 1,
    }

    assert result == exp
def test_get_error_detail_count(ptm):
    """Test get_error_detail_count method."""

    store_and_process_2_good_2_error_blobs(ptm)
    date_range = get_day_range(1)
    result = objectstore_refdata.get_error_detail_count(
        ptm.project,
        date_range["start"],
        date_range["stop"],
        )
    exp = {
        'four - Mozilla-Aurora - 14.0a2': 1,
        'one - Mozilla-Aurora - 14.0a2': 1,
        }

    assert result == exp
    def handle_project(self, project, **options):
        """Count errors of the project grouped by name, branch and version."""

        self.stdout.write("Processing project {0}\n".format(project))

        days_ago = options.get("days_ago")
        if not days_ago:
            raise CommandError(
                "You must supply days_ago."
            )
        numdays = options.get("numdays")

        range = utils.get_day_range(days_ago, numdays)
        if options.get("show_list"):
            err_list = objectstore_refdata.get_error_list(
                project,
                range["start"],
                range["stop"],
                )
            self.stdout.write(json.dumps(err_list, indent=4))

        if options.get("show_simple_count"):
            err_count = objectstore_refdata.get_error_count(
                project,
                range["start"],
                range["stop"],
                )
            self.stdout.write(json.dumps(err_count, indent=4))


        if options.get("show_detail_count"):
            err_count = objectstore_refdata.get_error_detail_count(
                project,
                range["start"],
                range["stop"],
                )
            ptm.disconnect()
            self.stdout.write(json.dumps(err_count, indent=4))
Exemplo n.º 4
0
    def handle_project(self, project, **options):
        """Count errors of the project grouped by name, branch and version."""

        self.stdout.write("Processing project {0}\n".format(project))

        days_ago = options.get("days_ago")
        if not days_ago:
            raise CommandError("You must supply days_ago.")
        numdays = options.get("numdays")

        range = utils.get_day_range(days_ago, numdays)
        if options.get("show_list"):
            err_list = objectstore_refdata.get_error_list(project, range["start"], range["stop"])
            self.stdout.write(json.dumps(err_list, indent=4))

        if options.get("show_simple_count"):
            err_count = objectstore_refdata.get_error_count(project, range["start"], range["stop"])
            self.stdout.write(json.dumps(err_count, indent=4))

        if options.get("show_detail_count"):
            err_count = objectstore_refdata.get_error_detail_count(project, range["start"], range["stop"])
            ptm.disconnect()
            self.stdout.write(json.dumps(err_count, indent=4))