Пример #1
0
 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~!"
Пример #2
0
 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"])
Пример #3
0
 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()
Пример #4
0
 def test_04_meta(self):
     commander(["meta", self.configfile])
Пример #5
0
 def test_03_sync(self):
     commander(["sync", self.configfile])
Пример #6
0
 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 --------------------------"
Пример #7
0
 def test_02_check(self):
     commander(["check", self.configfile])
Пример #8
0
 def test_01_mig(self):    
     commander(["run", self.configfile])
     print "----------------- wait for jobId full -------------"
     self.wait_for_mig_end()
     print "---------------- mig end --------------------------"
Пример #9
0
 def test_99_error_pk_not_numeric(self):
     commander([
         "run_with_no_retry", self.configfile, "--tablenames",
         "companycode", "persons9"
     ])
Пример #10
0
 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)
Пример #11
0
 def test_05_meta(self):
     commander(["remaindayall", self.configfile])