Open eskignax opened 5 years ago
Really?
pytest --help
...
--allure-link-pattern=LINK_TYPE:LINK_PATTERN
Url pattern for link type. Allows short links in test,
like 'issue-1'. Text will be formatted to full url
with python str.format().
...
So this parameter does not filter tests, it's for short testcase link in the report
By the way I'm also looking for a way to run tests based on allure testcase link...
@maxim-zaitsev links are marks too: https://github.com/allure-framework/allure-python/blob/master/allure-pytest/src/helper.py#L36, so you can implement filtering with pytest hook pytest_collection_modifyitems. Something like this https://github.com/allure-framework/allure-python/blob/master/allure-pytest/src/plugin.py#L142
I use this in my code to make it possible to trigger test by test case id from the allure test case link : https://docs.pytest.org/en/stable/example/markers.html#custom-marker-and-command-line-option-to-control-test-runs.
But would be nice to have this feature in the allure-python package directly (since you already have it for Epic ).
This works for me
pytest --allure-link-pattern tms:https://example.com/{}
@allure.testcase("TEST-456")
def test_blah_blah():
pass
Replace --allure-link-pattern='testcase:https://redmine.xxx.com/issues/25
by --allure-link-pattern='tms:https://redmine.xxx.com/issues/{}
I opened #786 to suggest renaming testcase
pattern name by tms
I'm submitting a ...
What is the current behavior?
--allure-link-pattern
option don't filter any test, and run the full suite.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
What is the expected behavior?
--allure-link-pattern
should only run the test with the matching link decorator.Please tell us about your environment:
Other information