Ejemplo n.º 1
0
                        nargs='+',
                        default="",
                        help='Required: Path to the Xunit XML files.')

    args = parser.parse_args()

    # Setup the SQL database but only if it does not exist
    sqlresults.set_database_filename(args.db)
    if not os.path.exists(args.db):
        sqlresults.setup_database()
    # Set up the reporter
    sql_reporter = sqlresults.SQLResultReporter()

    variables = args.variables
    # Add a new revision and get the "revision" number
    revision = sqlresults.add_revision()
    # Save the commitid
    commitid = args.commitid

    # If a directory has been provided, look there for all of the XML files
    if os.path.isdir(args.xmlpath[0]):
        xmldir = args.xmlpath[0]
        if not os.path.isabs(xmldir):
            xmldir = os.path.abspath(xmldir)
        xmlfiles = glob.glob(os.path.join(xmldir, '*.xml'))
    else:
        xmlfiles = args.xmlpath

    # Convert each file
    for file in xmlfiles:
        convert_xml(file)
Ejemplo n.º 2
0
    parser.add_argument('xmlpath', metavar='XMLPATH', type=str, nargs='+',
                        default="", 
                        help='Required: Path to the Xunit XML files.')
    
    args = parser.parse_args()
        
    # Setup the SQL database but only if it does not exist
    sqlresults.set_database_filename(args.db)
    if not os.path.exists(args.db):
        sqlresults.setup_database()
    # Set up the reporter    
    sql_reporter = sqlresults.SQLResultReporter()
    
    variables = args.variables 
    # Add a new revision and get the "revision" number
    revision = sqlresults.add_revision()
    # Save the commitid
    commitid = args.commitid

    # If a directory has been provided, look there for all of the XML files
    if os.path.isdir(args.xmlpath[0]):
        xmldir = args.xmlpath[0]
        if not os.path.isabs(xmldir):
            xmldir = os.path.abspath(xmldir)
        xmlfiles = glob.glob(os.path.join(xmldir, '*.xml'))
    else:
        xmlfiles = args.xmlpath
       
    # Convert each file
    for file in xmlfiles:
        convert_xml(file)