Exemple #1
0
def show_systest_groups(**kwargs):
    """Show Proboscis groups defined in Systest suite"""
    groups_nums = get_groups()

    out = {k: len(v) for k, v in groups_nums.items()
           if k.startswith('system_test')}
    print(pretty_log(out))
Exemple #2
0
def run(**kwargs):
    config_name = kwargs.get('config_name', None)
    groups = kwargs.get('run_groups', None)
    old_groups = kwargs.get('groups', None)
    explain = kwargs.get('explain', None)

    groups_to_run = []
    groups.extend(old_groups or [])
    for g in groups:
        if config_name:
            register_system_test_cases(
                groups=[g],
                configs=[config_name])
            groups_to_run.append("{0}({1})".format(g, config_name))
        else:
            register_system_test_cases(groups=[g])
            groups_to_run.append(g)
    if not set(groups_to_run) < set(get_groups()):
        sys.exit('There are no cases mapped to current group, '
                 'please be sure that you put right test group name.')
    if explain:
        print_explain(groups)
    else:
        register(groups=["run_system_test"], depends_on_groups=groups_to_run)
        TestProgram(groups=['run_system_test'],
                    argv=clean_argv()).run_and_exit()
Exemple #3
0
def show_systest_groups(**kwargs):
    """Show Proboscis groups defined in Systest suite"""
    groups_nums = get_groups()

    out = {k: len(v) for k, v in groups_nums.items()
           if k.startswith('system_test')}
    print(pretty_log(out))
Exemple #4
0
def run(**kwargs):
    config_name = kwargs.get('config_name', None)
    groups = kwargs.get('run_groups', [])
    old_groups = kwargs.get('groups', None)
    explain = kwargs.get('explain', None)

    groups_to_run = []
    groups.extend(old_groups or [])

    # Collect from pytest only once!
    pytest.main(['--collect-only', 'fuel_tests', ])
    from fuel_tests.tests.conftest import test_names

    for g in set(groups):
        if g in test_names:
            sys.exit(pytest.main('-m {}'.format(g)))
        if config_name:
            register_system_test_cases(
                groups=[g],
                configs=[config_name])
            groups_to_run.append("{0}({1})".format(g, config_name))
        else:
            register_system_test_cases(groups=[g])
            groups_to_run.append(g)
    if not set([split_group_config(i)[0] if split_group_config(i) else i
               for i in groups_to_run]) < set(get_groups()):
        sys.exit('There are no cases mapped to current group, '
                 'please be sure that you put right test group name.')
    if explain:
        print_explain(groups)
    else:
        register(groups=["run_system_test"], depends_on_groups=groups_to_run)
        TestProgram(groups=['run_system_test'],
                    argv=clean_argv_proboscis()).run_and_exit()
def run(**kwargs):
    config_name = kwargs.get('config_name', None)
    groups = kwargs.get('run_groups', [])
    old_groups = kwargs.get('groups', None)
    explain = kwargs.get('explain', None)

    groups_to_run = []
    groups.extend(old_groups or [])
    for g in set(groups):
        if config_name:
            register_system_test_cases(
                groups=[g],
                configs=[config_name])
            groups_to_run.append("{0}({1})".format(g, config_name))
        else:
            register_system_test_cases(groups=[g])
            groups_to_run.append(g)
    if not set([split_group_config(i)[0] if split_group_config(i) else i
               for i in groups_to_run]) < set(get_groups()):
        sys.exit('There are no cases mapped to current group, '
                 'please be sure that you put right test group name.')
    if explain:
        print_explain(groups)
    else:
        register(groups=["run_system_test"], depends_on_groups=groups_to_run)
        TestProgram(groups=['run_system_test'],
                    argv=clean_argv()).run_and_exit()
Exemple #6
0
def print_explain(names):
    groups_nums = get_groups()
    if not isinstance(names, list):
        names = [names]
    out = []
    for name in names:
        for i in groups_nums[name]:
            if hasattr(i, 'home'):
                out.append((i.home._proboscis_entry_.parent.home, i.home))
            else:
                out.append(i)
    print(pretty_log(out))
Exemple #7
0
def print_explain(names):
    groups_nums = get_groups()
    if not isinstance(names, list):
        names = [names]
    out = []
    for name in names:
        for i in groups_nums[name]:
            if hasattr(i, 'home'):
                out.append((i.home._proboscis_entry_.parent.home, i.home))
            else:
                out.append(i)
    print(pretty_log(out))
Exemple #8
0
def show_all_groups(**kwargs):
    """Show all Proboscis groups"""
    groups_nums = get_groups()
    out = {k: len(v) for k, v in groups_nums.items()}
    print(pretty_log(out))
Exemple #9
0
def show_all_groups(**kwargs):
    """Show all Proboscis groups"""
    groups_nums = get_groups()
    out = {k: len(v) for k, v in groups_nums.items()}
    print(pretty_log(out))