예제 #1
0
""" Script to perform set up necessary for the SQL database
of system tests.
THIS WILL DELETE YOUR DATABASE!

This is not strictly necessary because it will be created automatically 
when running the scripts.
"""
import sys
import time


import sqlresults
sqlresults.setup_database()
예제 #2
0
        default="",
        help='Commit ID of the current build (a 40-character SHA string).')

    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'))