def __init__(self, parent=None): QWidget.__init__(self, parent) self.ui = Ui_BuildSelectionHelper() self.ui.setupUi(self) self.ui.release.addItems([str(k) for k in sorted(releases())]) self.ui.combo_helper.currentIndexChanged.connect( self.ui.stackedWidget.setCurrentIndex)
def __init__(self, parent=None): QWidget.__init__(self, parent) self.ui = Ui_BuildSelectionHelper() self.ui.setupUi(self) self.ui.release.addItems([str(k) for k in sorted(releases())]) self.ui.combo_helper.activated.connect( self.ui.stackedWidget.setCurrentIndex)
def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli( '--bad=%s' % releases_data[-1][0], '--good=%s' % releases_data[0][0], ) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1]
def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli( '--bad-release=%s' % releases_data[-1][0], '--good-release=%s' % releases_data[0][0], ) assert str(conf.options.good_date) == releases_data[0][1] assert str(conf.options.bad_date) == releases_data[-1][1]
def test_valid_formatted_release_dates(self): formatted_output = formatted_valid_release_dates() firefox_releases = releases() for line in formatted_output.splitlines(): if "Valid releases: " in line: continue fields = line.replace(" ", "").split(":") version = int(fields[0]) date = fields[1] self.assertTrue(version in firefox_releases) self.assertEqual(date, firefox_releases[version])
def _create_widgets(self): self.stacked = QStackedWidget() self.datew = QDateEdit() self.datew.setDisplayFormat("yyyy-MM-dd") self.stacked.addWidget(self.datew) self.buildidw = QLineEdit() self.stacked.addWidget(self.buildidw) self.releasew = QComboBox() self.releasew.addItems([str(k) for k in sorted(releases())]) self.stacked.addWidget(self.releasew) self.select_combo = QComboBox() self.select_combo.addItems(['date', 'buildid', 'release']) self.select_combo.activated.connect(self.stacked.setCurrentIndex)
def test_valid_formatted_release_dates(self): formatted_output = formatted_valid_release_dates() firefox_releases = releases() for line in formatted_output.splitlines(): if "Valid releases: " in line: continue fields = line.translate(None, " ").split(":") version = int(fields[0]) date = fields[1] self.assertTrue(version in firefox_releases) self.assertEquals(date, firefox_releases[version])
def _create_widgets(self): self.stacked = QStackedWidget() self.datew = QDateEdit() self.datew.setDisplayFormat("yyyy-MM-dd") self.stacked.addWidget(self.datew) self.buildidw = QLineEdit() self.stacked.addWidget(self.buildidw) self.releasew = QComboBox() self.releasew.addItems([str(k) for k in sorted(releases())]) self.stacked.addWidget(self.releasew) self.revw = QLineEdit() self.stacked.addWidget(self.revw) self.select_combo = QComboBox() self.select_combo.addItems(['date', 'buildid', 'release', 'changeset']) self.select_combo.activated.connect(self.stacked.setCurrentIndex)
assert config.options.good == datetime.date.today() def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli( '--bad=%s' % releases_data[-1][0], '--good=%s' % releases_data[0][0], ) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1] @pytest.mark.parametrize('args,action,value', [ (['--launch=34'], 'launch_nightlies', cli.parse_date(releases()[34])), (['--launch=2015-11-01'], 'launch_nightlies', datetime.date(2015, 11, 1)), (['--launch=abc123'], 'launch_inbound', 'abc123'), (['--launch=2015-11-01', '--repo=m-i' ], 'launch_inbound', datetime.date(2015, 11, 1)), ]) def test_launch(args, action, value): config = do_cli(*args) assert config.action == action assert config.options.launch == value def test_bad_date_later_than_good(): with pytest.raises(errors.MozRegressionError) as exc: do_cli('--good=2015-01-01', '--bad=2015-01-10', '--find-fix') assert 'is later than good' in str(exc.value)
def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli("--bad=%s" % releases_data[-1][0], "--good=%s" % releases_data[0][0]) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1]
assert config.action == "bisect_nightlies" assert config.options.bad == default_bad_date assert config.options.good == datetime.date.today() def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli("--bad=%s" % releases_data[-1][0], "--good=%s" % releases_data[0][0]) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1] @pytest.mark.parametrize( "args,action,value", [ (["--launch=34"], "launch_nightlies", cli.parse_date(releases()[34])), (["--launch=2015-11-01"], "launch_nightlies", datetime.date(2015, 11, 1)), (["--launch=abc123"], "launch_inbound", "abc123"), (["--launch=2015-11-01", "--repo=m-i"], "launch_inbound", datetime.date(2015, 11, 1)), ], ) def test_launch(args, action, value): config = do_cli(*args) assert config.action == action assert config.options.launch == value def test_bad_date_later_than_good(): with pytest.raises(errors.MozRegressionError) as exc: do_cli("--good=2015-01-01", "--bad=2015-01-10", "--find-fix") assert "is later than good" in str(exc.value)
def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda k_v: k_v[0])) conf = do_cli( "--bad=%s" % releases_data[-1][0], "--good=%s" % releases_data[0][0], ) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1] @pytest.mark.parametrize( "args,action,value", [ (["--launch=34"], "launch_nightlies", cli.parse_date(releases()[34])), (["--launch=2015-11-01"], "launch_nightlies", datetime.date( 2015, 11, 1)), (["--launch=abc123"], "launch_integration", "abc123"), ( ["--launch=2015-11-01", "--repo=m-i"], "launch_integration", datetime.date(2015, 11, 1), ), ], ) def test_launch(args, action, value): config = do_cli(*args) assert config.action == action assert config.options.launch == value
def test_launch_with_release_number(arg): config = do_cli(arg) assert config.action == 'launch_nightlies' assert config.options.launch == cli.parse_date(releases()[34])
assert config.options.good == datetime.date.today() def test_with_releases(): releases_data = sorted(((k, v) for k, v in releases().items()), key=(lambda (k, v): k)) conf = do_cli( '--bad=%s' % releases_data[-1][0], '--good=%s' % releases_data[0][0], ) assert str(conf.options.good) == releases_data[0][1] assert str(conf.options.bad) == releases_data[-1][1] @pytest.mark.parametrize('args,action,value', [ (['--launch=34'], 'launch_nightlies', cli.parse_date(releases()[34])), (['--launch=2015-11-01'], 'launch_nightlies', datetime.date(2015, 11, 1)), (['--launch=abc123'], 'launch_inbound', 'abc123'), (['--launch=2015-11-01', '--repo=m-i'], 'launch_inbound', datetime.date(2015, 11, 1)), ]) def test_launch(args, action, value): config = do_cli(*args) assert config.action == action assert config.options.launch == value @pytest.mark.parametrize('args,repo,value', [ (['--launch=60.0', '--repo=m-r'], 'mozilla-release', 'FIREFOX_60_0_RELEASE'), (['--launch=61', '--repo=m-r'], 'mozilla-release', 'FIREFOX_61_0_RELEASE'), (['--launch=62.0.1'], 'mozilla-release', 'FIREFOX_62_0_1_RELEASE'),