chrome/test/chromedriver/test/run_java_tests.py
def _PrintTestResults(results_path):
  """Prints the given results in a format recognized by the buildbot."""
  with open(results_path, "r") as myfile:
    contents = myfile.read()

  successJunitTestsCount = re.search(r'OK \((\d* tests)', contents)

  if successJunitTestsCount:
    testsCount = re.findall(r'INFO: <<< Finished (.*)\)', contents)
    print("Ran %s tests " % len(testsCount))
    myfile.close()
    return 0

  print("============================")
  print("FAILURES DETAILS")
  print("============================")
  start = 'There w'
  end = 'FAILURES!!!'
  print(contents[contents.find(start):contents.rfind(end)])

  print("============================")
  print("SUMMARY")
  print("============================")
  testsCount = re.findall(r'INFO: <<< Finished (.*)\)', contents)
  print("Ran %s tests " % len(testsCount))

  failuresCount = re.search(r'There w.* (.*) failure', contents)
  if failuresCount:
    print("Failed %s tests" % failuresCount.group(1))
  failedTests = re.findall(r'^\d*\) (.*\(org.openqa.*\))',
       contents, re.MULTILINE)
  testsToReRun = []
  for test in failedTests:
    testName = test.split('(')[0]
    testClass = test.split('(')[1].split('.')[-1]
    testsToReRun.append(testClass[0:-1] + '.' + testName)
  print('Rerun failing tests with filter: ' + ':'.join(testsToReRun))

  myfile.close()
  return failuresCount.group(1)
Prints the given results in a format recognized by the buildbot.
Prints the given results in a format recognized by the buildbot.
Prints the given results in a format recognized by the buildbot .
def _PrintTestResults(results_path):
  with open(results_path, "r") as myfile:
    contents = myfile.read()
  successJunitTestsCount = re.search(r'OK \((\d* tests)', contents)
  if successJunitTestsCount:
    testsCount = re.findall(r'INFO: <<< Finished (.*)\)', contents)
    print("Ran %s tests " % len(testsCount))
    myfile.close()
    return 0
  print("============================")
  print("FAILURES DETAILS")
  print("============================")
  start = 'There w'
  end = 'FAILURES!!!'
  print(contents[contents.find(start):contents.rfind(end)])
  print("============================")
  print("SUMMARY")
  print("============================")
  testsCount = re.findall(r'INFO: <<< Finished (.*)\)', contents)
  print("Ran %s tests " % len(testsCount))
  failuresCount = re.search(r'There w.* (.*) failure', contents)
  if failuresCount:
    print("Failed %s tests" % failuresCount.group(1))
  failedTests = re.findall(r'^\d*\) (.*\(org.openqa.*\))',
       contents, re.MULTILINE)
  testsToReRun = []
  for test in failedTests:
    testName = test.split('(')[0]
    testClass = test.split('(')[1].split('.')[-1]
    testsToReRun.append(testClass[0:-1] + '.' + testName)
  print('Rerun failing tests with filter: ' + ':'.join(testsToReRun))
  myfile.close()
  return failuresCount.group(1)
def _PrintTestResults ( results_path ) : with open ( results_path , "r" ) as myfile : contents = myfile . read ( ) successJunitTestsCount = re . search ( r'OK \((\d* tests)' , contents ) if successJunitTestsCount : testsCount = re . findall ( r'INFO: <<< Finished (.*)\)' , contents ) print ( "Ran %s tests " % len ( testsCount ) ) myfile . close ( ) return 0 print ( "============================" ) print ( "FAILURES DETAILS" ) print ( "============================" ) start = 'There w' end = 'FAILURES!!!' print ( contents [ contents . find ( start ) : contents . rfind ( end ) ] ) print ( "============================" ) print ( "SUMMARY" ) print ( "============================" ) testsCount = re . findall ( r'INFO: <<< Finished (.*)\)' , contents ) print ( "Ran %s tests " % len ( testsCount ) ) failuresCount = re . search ( r'There w.* (.*) failure' , contents ) if failuresCount : print ( "Failed %s tests" % failuresCount . group ( 1 ) ) failedTests = re . findall ( r'^\d*\) (.*\(org.openqa.*\))' , contents , re . MULTILINE ) testsToReRun = [ ] for test in failedTests : testName = test . split ( '(' ) [ 0 ] testClass = test . split ( '(' ) [ 1 ] . split ( '.' ) [ - 1 ] testsToReRun . append ( testClass [ 0 : - 1 ] + '.' + testName ) print ( 'Rerun failing tests with filter: ' + ':' . join ( testsToReRun ) ) myfile . close ( ) return failuresCount . group ( 1 )
Prints the given results in a format recognized by the buildbot.
Prints the given results in a format recognized by the buildbot .
"""Prints the given results in a format recognized by the buildbot."""
results_path