How to use the mozregression.build_range.FutureBuildInfo function in mozregression

To help you get started, we’ve selected a few mozregression examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / mozregression / tests / unit / test_bisector.py View on Github external
def __init__(self, *a, **kwa):
                build_range.FutureBuildInfo.__init__(self, *a, **kwa)
                self._build_info = Mock(data=self.data)
github mozilla / mozregression / tests / unit / test_build_range.py View on Github external
def _build_range(fb, rng):
    return build_range.BuildRange(
        fb.build_info_fetcher, [build_range.FutureBuildInfo(fb.build_info_fetcher, i) for i in rng],
    )
github mozilla / mozregression / tests / unit / test_approx_persist.py View on Github external
def create_build_range(values):
    info_fetcher = None  # we should not need to access it

    data = []
    for v in values:
        data.append(build_range.FutureBuildInfo(info_fetcher, v))
    return build_range.BuildRange(info_fetcher, data)
github mozilla / mozregression / tests / unit / test_build_range.py View on Github external
def test_tc_range_before_after(mocker, func, start, size, expected_range):
    ftc = build_range.FutureBuildInfo(mocker.Mock(), mocker.Mock(push_id=start))

    def pushes(startID, endID):
        # startID: greaterThan  -  endID: up to and including
        # http://mozilla-version-control-tools.readthedocs.org/en/latest/hgmo/pushlog.html#query-parameters  # noqa
        return list(range(startID + 1, endID + 1))

    ftc.build_info_fetcher.jpushes.pushes.side_effect = pushes
    rng = func(ftc, size)
    assert len(rng) == size
    assert [rng.get_future(i).data for i in range(len(rng))] == expected_range
github mozilla / mozregression / mozregression / build_range.py View on Github external
def get_nightly_range(fetch_config, start_date, end_date, expand=0, interrupt=None):
    """
    Creates a BuildRange for nightlies.
    """
    info_fetcher = NightlyInfoFetcher(fetch_config)
    futures_builds = []
    # build the build range using only dates
    sd = to_date(start_date)
    for i in range((to_date(end_date) - sd).days + 1):
        futures_builds.append(FutureBuildInfo(info_fetcher, sd + datetime.timedelta(days=i)))
    # and now put back the real start and end dates
    # in case they were datetime instances (coming from buildid)
    futures_builds[0].data = start_date
    futures_builds[-1].data = end_date
    return BuildRange(info_fetcher, futures_builds)
github mozilla / mozregression / gui / mozregui / skip_chooser.py View on Github external
"Closing this dialog will end the bisection. Are you sure"
                " you want to end the bisection now ?",
                QMessageBox.Yes | QMessageBox.No,
                QMessageBox.No,
            )
            == QMessageBox.Yes
        ):
            evt.accept()
        else:
            evt.ignore()


if __name__ == "__main__":
    from mozregression.build_range import BuildRange, FutureBuildInfo

    class FInfo(FutureBuildInfo):
        def _fetch(self):
            return self.data

    build_range = BuildRange(None, [FInfo(None, i) for i in range(420)])

    from PySide2.QtWidgets import QApplication, QMainWindow

    app = QApplication([])
    win = QMainWindow()

    dlg = SkipDialog(build_range)