Пример #1
0
def handle_testcase(case, suite_name):
    """ Handle one test case and save it to DB"""
    # Build the full name (Project.Suite.Case)
    name = case.getAttribute("classname") + "." + case.getAttribute("name")
    try:
        time = float(case.getAttribute("time"))
    except:
        time = 0.0
    try:
        total_time = float(case.getAttribute("totalTime"))
    except:
        total_time = 0.0
    try:
        cpu_fraction = float(case.getAttribute("CPUFraction"))
    except:
        cpu_fraction = 0.0
        
    
    tr = TestResult(date = datetime.datetime.now(),
                 name=name,
                 type="performance",
                 host=platform.uname()[1],
                 environment=envAsString(),
                 runner="ctest",
                 revision=revision,
                 commitid=commitid,
                 runtime=time,
                 cpu_fraction=cpu_fraction,
                 success=True,
                 status="",
                 log_contents="",
                 variables=variables) 
    #print tr.data
    # Now report it to SQL
    sql_reporter.dispatchResults(tr)
Пример #2
0
    # Build the full name (Project.Suite.Case)
    name = case.getAttribute("classname") + "." + case.getAttribute("name")
    try:
        time = float(case.getAttribute("time"))
    except:
        time = 0.0
    try:
        cpu_fraction = float(case.getAttribute("CPUFraction"))
    except:
        cpu_fraction = 0.0

    tr = TestResult(date=datetime.datetime.now(),
                    name=name,
                    type="performance",
                    host=platform.uname()[1],
                    environment=envAsString(),
                    runner="ctest",
                    revision=revision,
                    commitid=commitid,
                    runtime=time,
                    cpu_fraction=cpu_fraction,
                    success=True,
                    status="",
                    log_contents="",
                    variables=variables)
    #print tr.data
    # Now report it to SQL
    sql_reporter.dispatchResults(tr)


def handle_suite(suite):