Пример #1
0
def test_get_integration_range_with_dates(mocker, start_date, end_date,
                                          start_call, end_call):
    fetch_config = create_config('firefox', 'linux', 64, 'x86_64')
    jpush_class = mocker.patch('mozregression.fetch_build_info.JsonPushes')
    jpush = mocker.Mock(
        pushes_within_changes=mocker.Mock(return_value=[]),
        spec=JsonPushes
    )
    jpush_class.return_value = jpush

    build_range.get_integration_range(fetch_config, start_date, end_date,
                                      time_limit=DATE_YEAR_BEFORE)

    jpush.pushes_within_changes.assert_called_once_with(start_call, end_call)
Пример #2
0
def test_get_integration_range_with_expand(mocker):
    fetch_config = create_config("firefox", "linux", 64, "x86_64")
    jpush_class = mocker.patch("mozregression.fetch_build_info.JsonPushes")
    pushes = [create_push("b", 1), create_push("d", 2), create_push("f", 3)]
    jpush = mocker.Mock(pushes_within_changes=mocker.Mock(return_value=pushes),
                        spec=JsonPushes)
    jpush_class.return_value = jpush

    check_expand = mocker.patch(
        "mozregression.build_range.BuildRange.check_expand")

    build_range.get_integration_range(fetch_config, "a", "e", expand=10)

    check_expand.assert_called_once_with(10,
                                         build_range.tc_range_before,
                                         build_range.tc_range_after,
                                         interrupt=None)
Пример #3
0
def test_get_integration_range_with_expand(mocker):
    fetch_config = create_config('firefox', 'linux', 64, 'x86_64')
    jpush_class = mocker.patch('mozregression.fetch_build_info.JsonPushes')
    pushes = [create_push('b', 1), create_push('d', 2), create_push('f', 3)]
    jpush = mocker.Mock(
        pushes_within_changes=mocker.Mock(return_value=pushes),
        spec=JsonPushes
    )
    jpush_class.return_value = jpush

    check_expand = mocker.patch(
        'mozregression.build_range.BuildRange.check_expand')

    build_range.get_integration_range(fetch_config, 'a', 'e', expand=10)

    check_expand.assert_called_once_with(
        10, build_range.tc_range_before, build_range.tc_range_after,
        interrupt=None)
Пример #4
0
def test_get_integration_range(mocker):
    fetch_config = create_config("firefox", "linux", 64, "x86_64")
    jpush_class = mocker.patch("mozregression.fetch_build_info.JsonPushes")
    pushes = [create_push("b", 1), create_push("d", 2), create_push("f", 3)]
    jpush = mocker.Mock(pushes_within_changes=mocker.Mock(return_value=pushes),
                        spec=JsonPushes)
    jpush_class.return_value = jpush

    b_range = build_range.get_integration_range(fetch_config, "a", "e")

    jpush_class.assert_called_once_with(branch="mozilla-central")
    jpush.pushes_within_changes.assert_called_once_with("a", "e")
    assert isinstance(b_range, build_range.BuildRange)
    assert len(b_range) == 3

    b_range.build_info_fetcher.find_build_info = lambda v: v
    assert b_range[0] == pushes[0]
    assert b_range[1] == pushes[1]
    assert b_range[2] == pushes[2]

    b_range.future_build_infos[0].date_or_changeset() == "b"
Пример #5
0
def test_get_integration_range(mocker):
    fetch_config = create_config('firefox', 'linux', 64, 'x86_64')
    jpush_class = mocker.patch('mozregression.fetch_build_info.JsonPushes')
    pushes = [create_push('b', 1), create_push('d', 2), create_push('f', 3)]
    jpush = mocker.Mock(
        pushes_within_changes=mocker.Mock(return_value=pushes),
        spec=JsonPushes
    )
    jpush_class.return_value = jpush

    b_range = build_range.get_integration_range(fetch_config, 'a', 'e')

    jpush_class.assert_called_once_with(branch='mozilla-central')
    jpush.pushes_within_changes.assert_called_once_with('a', 'e')
    assert isinstance(b_range, build_range.BuildRange)
    assert len(b_range) == 3

    b_range.build_info_fetcher.find_build_info = lambda v: v
    assert b_range[0] == pushes[0]
    assert b_range[1] == pushes[1]
    assert b_range[2] == pushes[2]

    b_range.future_build_infos[0].date_or_changeset() == 'b'