def test_99_error_pk_not_numeric_raise(self): try: commander([ "run_with_no_retry", self.configfile, "--tablenames", "companycode" ]) self.assertTrue(False, "this routin must raise exception") except: print sys.exc_info() print "FAIL is OK~!"
def test_run_range(self): datasource = MsSqlDatasource(db_config = migbq.migutils.get_connection_info(getenv("pymig_config_path")), meta_db_type = "mssql", meta_db_config = migbq.migutils.get_connection_info(getenv("pymig_config_path")), config = migbq.migutils.get_config(getenv("pymig_config_path")) ) bq = BigQueryForwarder(dataset = get_config(getenv("pymig_config_path")).source["out"]["dataset"] , prefix="", config = get_config( getenv("pymig_config_path") )) datasource.log.setLevel(logging.DEBUG) bq.log.setLevel(logging.DEBUG) commander(["run_range",getenv("pymig_config_path"),"--tablenames","persons9","--range","0,10+12,15+20,30+100,101"])
def test_11_mig_range_queue(self): metadb = self.reset_temp_db() commander([ "run_range_queued", self.configfile, "--range", "0,234", "--range_batch_size", "100" ]) self.wait_for_mig_end_inner( metadb.meta_log, logidxs=[int(r.pageToken) for r in metadb.meta_log.select()]) tablename = self.get_tablename_in_queue()
def test_04_meta(self): commander(["meta", self.configfile])
def test_03_sync(self): commander(["sync", self.configfile])
def test_02_retry(self): self.make_error_job() commander(["run", self.configfile]) print "----------------- wait for jobId full -------------" self.wait_for_mig_end() print "---------------- mig end --------------------------"
def test_02_check(self): commander(["check", self.configfile])
def test_01_mig(self): commander(["run", self.configfile]) print "----------------- wait for jobId full -------------" self.wait_for_mig_end() print "---------------- mig end --------------------------"
def test_99_error_pk_not_numeric(self): commander([ "run_with_no_retry", self.configfile, "--tablenames", "companycode", "persons9" ])
def test_99_sync_schema(self): colname = "tag_%s" % datetime.datetime.now().strftime("%Y%m%d_%H%M%S") self.add_field_mssql(colname) commander(["sync_schema_all_in_meta", self.configfile]) self.drop_field_mssql(colname)
def test_05_meta(self): commander(["remaindayall", self.configfile])