Github user amyrazz44 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1007#discussion_r87322648
  
    --- Diff: src/test/feature/gtest-parallel ---
    @@ -234,6 +234,71 @@ class TestTimes(object):
         except IOError:
           pass  # ignore errors---saving the times isn't that important
     
    +
    +def get_schedule(schedule_file):
    +  "read schedule file from --gtest_schedule option"
    +  try:
    +    file = open(schedule_file, 'r')
    +  except (EOFError, IOError):
    +    sys.exit("Read file error")
    +  
    +  filter_test = []
    +  ptest = []
    +  stest = []
    +
    +  for line in file.readlines():
    +    if not line.strip():
    +      continue
    +    if line[0] == '#':
    +      continue
    +
    +    testline = line.split('=')
    +    if len(testline) != 2 or (not testline[1].strip()):
    +      sys.exit("format error in schedule file")
    +    
    +    (key, value) = testline
    +    if key == "PARALLEL":
    +      ptest.append(value) 
    +    elif key == "SERIAL":
    +      stest.append(value)
    +    else:
    +      sys.exit("format error in schedule file")
    +
    +  filter_test = ptest + stest      
    +  file.close()
    +  return len(ptest), filter_test
    +
    +
    +def do_gtest_filter(list_command, command, op_filter):
    +    "get tests by --gtest_filter and --gtest_list_tests"
    +    list_command += ['--gtest_filter=' + op_filter]
    +    try:
    +      test_list = subprocess.Popen(list_command + ['--gtest_list_tests'],
    +                                 stdout=subprocess.PIPE).communicate()[0]
    +    except OSError as e:
    +      sys.exit("%s: %s" % (test_binary, str(e)))
    +
    +    command += additional_args
    +    tests = []
    +    test_group = ''
    +    for line in test_list.split('\n'):
    +      if not line.strip():
    --- End diff --
    
    To deal with the blank line.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to