Skip to content

Commit

Permalink
support for searching test by ID (via #571)
Browse files Browse the repository at this point in the history
  • Loading branch information
MissiaL authored Mar 22, 2021
1 parent fcc6bcd commit fa4e2ff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions allure-pytest/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ def a_label_type(string):
help="""Comma-separated list of story names.
Run tests that have at least one of the specified story labels.""")

parser.getgroup("general").addoption('--allure-ids',
action="store",
dest="allure_ids",
metavar="IDS_SET",
default={},
type=label_type(LabelType.ID),
help="""Comma-separated list of IDs.
Run tests that have at least one of the specified id labels.""")

def link_pattern(string):
pattern = string.split(':', 1)
if not pattern[0]:
Expand Down Expand Up @@ -145,6 +154,7 @@ def select_by_labels(items, config):
arg_labels = set().union(config.option.allure_epics,
config.option.allure_features,
config.option.allure_stories,
config.option.allure_ids,
config.option.allure_severities)
return filter(lambda item: arg_labels & set(allure_labels(item)) if arg_labels else True, items)

Expand Down

0 comments on commit fa4e2ff

Please sign in to comment.