def run(spec, basedir): print "Creating or updating %s" % spec s = dbspec.DBSpec.from_url(spec) sm = DBSchemaManager(s, basedir) print "Currently at %s, upgrading to latest" % sm.get_db_version() sm.upgrade() print "Done"
def setUp(self): if os.path.exists(self.basedir): shutil.rmtree(self.basedir) os.makedirs(self.basedir) spec = dbspec.DBSpec.from_url("sqlite:///state.sqlite", self.basedir) manager = DBSchemaManager(spec, self.basedir) manager.upgrade() self.dbc = connector.DBConnector(spec) self.dbc.start()
def setUp(self): if os.path.exists(self.basedir): shutil.rmtree(self.basedir) os.makedirs(self.basedir) spec = dbspec.DBSpec.from_url("sqlite:///state.sqlite", self.basedir) # For testing against mysql, uncomment this # spec = dbspec.DBSpec.from_url("mysql://buildbot@localhost/buildbot_schedulers", self.basedir) manager = DBSchemaManager(spec, self.basedir) manager.upgrade() self.dbc = connector.DBConnector(spec) self.dbc.start()
def setUp(self): if os.path.exists(self.basedir): shutil.rmtree(self.basedir) os.makedirs(self.basedir) spec = dbspec.DBSpec.from_url("sqlite:///state.sqlite", self.basedir) manager = DBSchemaManager(spec, self.basedir) manager.upgrade() self.dbc = connector.DBConnector(spec) self.dbc.start() self._patcher = mock.patch("buildbotcustom.scheduler.now") self._time = self._patcher.start() self._time.return_value = 123
def setUp(self): if os.path.exists(self.basedir): shutil.rmtree(self.basedir) os.makedirs(self.basedir) spec = dbspec.DBSpec.from_url("sqlite:///state.sqlite", self.basedir) manager = DBSchemaManager(spec, self.basedir) manager.upgrade() self.dbc = connector.DBConnector(spec) self.dbc.start() self.s = Scheduler(name="s", builderNames=["b1"]) self.s.parent = mock.Mock() self.s.parent.db = self.dbc return self.dbc.addSchedulers([self.s])