from pong.exporter import Exporter suite = Exporter("../../pong-results.xml") suite.create_test_run("Sean Toner Template Automation Testing", "Jenkins Run")
default="RedHatEnterpriseLinux7") parser.add_argument("--test-run-id", help="Unique ID of a Test Run") parser.add_argument("--pong-path", help="Path to pong-results.xml file", default="../../pong-results.xml") args = parser.parse_args() tr = get_test_run(project_id=args.project, test_run_id=args.test_run_id) if tr.query is not None: # tr.query = "(title:rhsm.cli.* OR title:rhsm.gui.*)" tr.query = None if tr.select_test_cases_by != "automatedProcess": #tr.select_test_cases_by = "staticQueryResult" tr.select_test_cases_by = "automatedProcess" if not tr.project_id: tr.project_id = "RedHatEnterpriseLinux7" if not tr.template: tr.template = "sean toner test template" done = 3 while done > 0: try: tr.update() done = 0 except ssl.SSLError as se: # give 3 tries total done -= 1 suite = Exporter(args.testng_path) suite.update_test_run(tr)
key, val = kv val = val.replace("\n", "").lstrip() key1 = "--" + key.lower().replace("_", "-") if "testrun-jenkins-jobs" in key1: key1 = "--testrun-jenkinsjobs" if key1 == "--planned-in-milestone": key1 = "--testrun-plannedin" if key1 == "--testcase-prefix": if val.endswith(":"): val += " " return key1, val cmdline_args = map(composer, map(lambda l: l.split("="), lines[1:])) # cmdline_args = zip(cmd_args, map(cfgget, keys_p)) arglist = [] for opts in cmdline_args: arglist.extend(opts) arglist.extend(["--test-case-skips", "True"]) for i, arg in enumerate(arglist): if arg == "--result-path" and args.result_path is not None: arglist[i+1] = args.result_path break config_map = kickstart(args=arglist) Exporter.export(config_map)