Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds support for running tests by suite or parent suite allure label #633

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions allure-pytest/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,24 @@ def a_label_type(string):
help="""Comma-separated list of IDs.
Run tests that have at least one of the specified id labels.""")

parser.getgroup("general").addoption('--allure-parent-suites',
action="store",
dest="allure_parent_suites",
metavar="PARENT_SUITES_SET",
default={},
type=label_type(LabelType.PARENT_SUITE),
help="""Comma-separated list of parent suites.
Run tests that have at least one of the specified parent suite labels.""")

parser.getgroup("general").addoption('--allure-suites',
action="store",
dest="allure_suites",
metavar="SUITES_SET",
default={},
type=label_type(LabelType.SUITE),
help="""Comma-separated list of suites.
Run tests that have at least one of the specified suite labels.""")

def link_pattern(string):
pattern = string.split(':', 1)
if not pattern[0]:
Expand Down Expand Up @@ -155,6 +173,8 @@ def select_by_labels(items, config):
config.option.allure_features,
config.option.allure_stories,
config.option.allure_ids,
config.option.allure_suites,
config.option.allure_parent_suites,
config.option.allure_severities)
if arg_labels:
selected, deselected = [], []
Expand Down