def parse_yaml(yaml): jobs = utils.load_yaml(yaml) url = utils.validate_input(jobs['username'], jobs['token'], jobs['server']) connection = utils.connect(url) duration = jobs['duration'] # Remove unused data jobs.pop('duration') jobs.pop('username') jobs.pop('token') jobs.pop('server') return connection, jobs, duration
def count_scope_pass_number(test_suite_scope_dict, path, result): workspace = os.getenv("WORKSPACE") test_suite_dir = os.path.join(workspace, "local/ci-test-cases") yaml_file = utils.load_yaml(os.path.join(test_suite_dir, path)) for scope in yaml_file['metadata']['scope']: if result == 'pass': if scope not in test_suite_scope_dict: test_suite_scope_dict[scope] = 1 else: value = test_suite_scope_dict[scope] value = value + 1 test_suite_scope_dict[scope] = value
def count_scope_pass_number(test_suite_scope_dict, path, result): # TODO : use parameters if TEST_CASE_DEFINITION_DIR: test_suite_dir = TEST_CASE_DEFINITION_DIR else: workspace = os.getenv("WORKSPACE") test_suite_dir = os.path.join(workspace, "local/ci-test-cases") yaml_file = utils.load_yaml(os.path.join(test_suite_dir, path)) if not 'scope' in yaml_file['metadata']: # TODO : use default unknown scope for these test suit return for scope in yaml_file['metadata']['scope']: if result == 'pass': if scope not in test_suite_scope_dict: test_suite_scope_dict[scope] = 1 else: value = test_suite_scope_dict[scope] value = value + 1 test_suite_scope_dict[scope] = value