예제 #1
0
  def check_valid(self):
    """ Will check if a test is valid. The following points can declare a test valid:
        1. Contains the files required
        2. Not listed in the skipped_tests.json
        3. Not listed in the args.skip cmd line argument

    Arguments:
        self: Class function
    """
    # Test 1
    if not validate_test.validate_path(self.path_, verb = False):
        self.skip_ = True
        self.skip_reason_ = 'Failed validate_test, missing files'
        return

    # Test 2
    # Figure out if the test should be skipped
    skip_json = json.loads(open("skipped_tests.json").read())
    for skip in skip_json:
        if self.path_ == skip['name']:
            self.skip_ = True
            self.skip_reason_ = 'Defined in skipped_tests.json'
            return

    # Test 3
    if self.path_ in args.skip or self.category_ in args.skip:
            self.skip_ = True
            self.skip_reason_ = 'Defined by cmd line argument'
            return

    self.skip_ = False
    self.skip_reason_ = None
    return
예제 #2
0
  def check_valid(self):
    """ Will check if a test is valid. The following points can declare a test valid:
        1. Contains the files required
        2. Not listed in the skipped_tests.json
        3. Not listed in the args.skip cmd line argument

    Arguments:
        self: Class function
    """
    # Test 1
    if not validate_test.validate_path(self.path_, verb = False):
        self.skip_ = True
        self.skip_reason_ = 'Failed validate_test, missing files'
        return

    # Test 2
    # Figure out if the test should be skipped
    skip_json = json.loads(open("skipped_tests.json").read())
    for skip in skip_json:
        if self.path_ == skip['name']:
            self.skip_ = True
            self.skip_reason_ = 'Defined in skipped_tests.json'
            return

    # Test 3
    if self.path_ in args.skip or self.category_ in args.skip:
            self.skip_ = True
            self.skip_reason_ = 'Defined by cmd line argument'
            return

    self.skip_ = False
    self.skip_reason_ = None
    return
예제 #3
0
def valid_tests(verb = False):
  tests = []

  dirs = os.walk('.').next()[1]
  for directory in  dirs:
    subdirs = os.walk(directory).next()[1]
    if "integration" in subdirs:
      subdirs = os.walk(directory + "/integration").next()[1]
      if subdirs:
        for d in subdirs:
          path = directory + "/integration/" + d
          if validate_test.validate_path(path, verb):
            tests.append(path)
          else:
            print color.WARNING("Validator: " + path + " failed validation")

  return tests
예제 #4
0
def valid_tests(verb=False):
    tests = []

    dirs = os.walk('.').next()[1]
    for directory in dirs:
        subdirs = os.walk(directory).next()[1]
        if "integration" in subdirs:
            subdirs = os.walk(directory + "/integration").next()[1]
            if subdirs:
                for d in subdirs:
                    path = directory + "/integration/" + d
                    if validate_test.validate_path(path, verb):
                        tests.append(path)
                    else:
                        print color.WARNING("Validator: " + path +
                                            " failed validation")

    return tests
예제 #5
0
def stress_test():
  """Perform stresstest"""
  global test_count
  test_count += 1
  if ("stress" in args.skip):
    print pretty.WARNING("Stress test skipped")
    return 0

  if (not validate_test.validate_path("stress")):
    raise Exception("Stress test failed validation")

  print pretty.HEADER("Starting stress test")
  stress = Test("stress", clean = args.clean).start()

  if (stress and args.fail):
    print pretty.FAIL("Stress test failed")
    sys.exit(stress)

  return 1 if stress.wait_status() else 0
예제 #6
0
def stress_test():
  """Perform stresstest"""
  global test_count
  test_count += 1
  if ("stress" in args.skip):
    print pretty.WARNING("Stress test skipped")
    return 0

  if (not validate_test.validate_path("stress")):
    raise Exception("Stress test failed validation")

  print pretty.HEADER("Starting stress test")
  stress = Test("stress", clean = args.clean).start()

  if (stress and args.fail):
    print pretty.FAIL("Stress test failed")
    sys.exit(stress)

  return 1 if stress.wait_status() else 0