Example #1
0
    def handle_project(self, project, **options):
        """Report pushlogs not referenced with tests in the project."""

        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")
        branches = options.get("branches")

        range = utils.get_day_range(days_ago, numdays)
        if branches:
            branches = branches.split(",")
        else:
            branches = pushlog_refdata.get_all_branches()


        stats = pushlog_refdata.get_not_referenced(
            project,
            range["start"],
            range["stop"],
            branches,
            )
        print json.dumps(stats, indent=4)
        return
Example #2
0
    def handle_project(self, project, **options):
        """Report pushlogs not referenced with tests in the project."""

        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")
        branches = options.get("branches")

        range = utils.get_day_range(days_ago, numdays)
        if branches:
            branches = branches.split(",")
        else:
            branches = pushlog_refdata.get_all_branches()

        stats = pushlog_refdata.get_not_referenced(
            project,
            range["start"],
            range["stop"],
            branches,
        )
        print json.dumps(stats, indent=4)
        return
Example #3
0
def test_get_all_branches(plm, monkeypatch):
    """Test get_all_branches method."""
    def mock_plm():
        return plm

    monkeypatch.setattr(factory, 'get_plm', mock_plm)

    exp_branch_list = [
        u"Firefox", u"Try", u"Mozilla-Aurora", u"Mozilla-Beta",
        u"Mozilla-Release", u"Mozilla-Esr10", u"Accessibility", u"Addon-SDK",
        u"Build-System", u"Devtools", u"Fx-Team", u"Ionmonkey",
        u"J\xe4gerMonkey", u"Profiling", u"Services-Central", u"UX", u"Alder",
        u"Ash", u"Birch", u"Cedar", u"Elm", u"Holly", u"Larch", u"Maple",
        u"Oak", u"Pine", u"Electrolysis", u"Graphics", u"Places",
        u"Mozilla-Inbound"
    ]

    assert set(exp_branch_list) == set(pushlog_refdata.get_all_branches())
def test_get_all_branches(plm, monkeypatch):
    """Test get_all_branches method."""

    def mock_plm():
        return plm
    monkeypatch.setattr(factory, 'get_plm', mock_plm)

    exp_branch_list = [
        u"Firefox",
        u"Try",
        u"Mozilla-Aurora",
        u"Mozilla-Beta",
        u"Mozilla-Release",
        u"Mozilla-Esr10",
        u"Accessibility",
        u"Addon-SDK",
        u"Build-System",
        u"Devtools",
        u"Fx-Team",
        u"Ionmonkey",
        u"J\xe4gerMonkey",
        u"Profiling",
        u"Services-Central",
        u"UX",
        u"Alder",
        u"Ash",
        u"Birch",
        u"Cedar",
        u"Elm",
        u"Holly",
        u"Larch",
        u"Maple",
        u"Oak",
        u"Pine",
        u"Electrolysis",
        u"Graphics",
        u"Places",
        u"Mozilla-Inbound"
    ]

    assert set(exp_branch_list) == set(pushlog_refdata.get_all_branches())
Example #5
0
def get_all_branches(request):
    """Get the full list of pushlog branches"""
    branches = pushlog_refdata.get_all_branches()
    return HttpResponse(json.dumps(branches), content_type=API_CONTENT_TYPE)
Example #6
0
def get_all_branches(request):
    """Get the full list of pushlog branches"""
    branches = pushlog_refdata.get_all_branches()
    return HttpResponse(json.dumps(branches), content_type=API_CONTENT_TYPE)