def __init__(self, xml, db_schema="madlib"): Parser.__init__(self, xml) self.algorithms = {} algorithms = Parser.getNodeTag(self, self.xmlDoc, "algorithms") algorithm_list = Parser.getNodeList(self, algorithms, "algorithm") self.algorithm_map = {} self.algorithms = [AlgorithmTemplate(algorithm, db_schema) for algorithm in algorithm_list] for algorithm in self.algorithms: self.algorithm_map[algorithm.name] = algorithm
def getDataSets(self): """Return map of datasets. key: datasetName value: dic(method : parameter) """ datasets = Parser.getNodeTag(self, self.xmlDoc, "datasets") dsList = Parser.getNodeList(self, datasets, "dataset") self.num = len(dsList) for dsNode in dsList: self.__getDataSet(dsNode) return self.descs
def __init__(self, xml, db_schema='madlib'): Parser.__init__(self, xml) self.algorithms = {} algorithms = Parser.getNodeTag(self, self.xmlDoc, "algorithms") algorithm_list = Parser.getNodeList(self, algorithms, "algorithm") self.algorithm_map = {} self.algorithms = [ AlgorithmTemplate(algorithm, db_schema) for algorithm in algorithm_list ] for algorithm in self.algorithms: self.algorithm_map[algorithm.name] = algorithm
def getDataSets(self): """Return map of datasets. key: datasetName value: dic(method : parameter) """ datasets = Parser.getNodeTag(self, self.xmlDoc,"datasets") dsList = Parser.getNodeList(self, datasets, "dataset") self.num = len(dsList) for dsNode in dsList: self.__getDataSet(dsNode) return self.descs
def __multiTestSuite(self, mlTs, tsType, debug): """Parse one multi-test suite. params: mlTs: multi-test suite node tsType: <test_type> """ algorithm = Parser.getNodeVal(self, mlTs, "algorithm") # parse pre parameters (hash table) methods = Parser.getNodeTag(self, mlTs, "methods") mtdNodeList = Parser.getNodeList(self, methods, "method") preParas = self.__preParas(mtdNodeList) # get test suite nodes list tsNodeList = Parser.getNodeList(self, mlTs, "test_suite") # init a MutiTestSuite instance mlTs = multi_testsuite.MultiTestSuite(self.configer, self.analyticsTools, \ self.datasets, self.paraHandler, algorithm, preParas, \ tsNodeList, tsType, self.caseScheduleFileHd, \ self.caseSQLFileHd, self.testSuiteSqlHd, self.testItemSqlHd) mlTs.GenCases(debug)
def GenCases(self, debug = False): """Generate cases for each test case xml spec file Parse the root tag <test_suites>. <test_type> has two options: feature and performance. For performance test, each test case should be wraped by gpstart and gpstop output: 1) one case schedule file which include gpstart/gpstop and test case file name, as caseScheduleF in __init__'s para 2) multiply test case file with executor commands 3) one sql output file, as caseSQLF in __init__'s para 4) one sql file of inserting test suite, as tsSqlF in __init__'s para 5) one sql file of inserting test case, as tiSqlF in __init__'s para """ ts = Parser.getNodeTag(self, self.xmlDoc, "test_suites") tsType = Parser.getNodeVal(self, ts, "test_type") mulTsList = Parser.getNodeList(self, ts, "multi_test_suites") # loop to parse each multi test suite for mulTs in mulTsList: self.__multiTestSuite(mulTs, tsType, debug)