★ wanayoo — archive 1999 https://github.com/allure-framework/allure-python/issues/433Nouvelle recherche | Portail wanayoo
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

--allure-link-pattern option don't filter any test. #433

Open
eskignax opened this issue Oct 1, 2019 · 3 comments
Open

--allure-link-pattern option don't filter any test. #433

eskignax opened this issue Oct 1, 2019 · 3 comments

Comments

@eskignax
Copy link

@eskignax eskignax commented Oct 1, 2019

I'm submitting a ...

  • [ X ] bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

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

import allure

@allure.testcase('https://redmine.xxx.com/issues/25','25')
def test_with_allure_link():
    pass

def test_without_allure_link():
    pass
(venv) bash-5.0$ python3 -m pytest --allure-link-pattern='testcase:https://redmine.xxx.com/issues/25'
======================================================================================= test session starts ========================================================================================
platform linux -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
rootdir: /home/xxx/PycharmProjects/sandbox/bugs
plugins: allure-pytest-2.7.0
collected 2 items                                                                                                                                                                                  

test_allure_link.py ..                                                                                                                                                                       [100%]

===================================================================================== 2 passed in 0.02 seconds =====================================================================================

What is the expected behavior?

--allure-link-pattern should only run the test with the matching link decorator.

Please tell us about your environment:

  • Allure version: 2.8.1
  • Test framework: pytest@5.1.2 also tested on 5.1.0
  • Allure adaptor: allure-pytest@2.8.4 also tested on 2.7.0

Other information

python3 -m pytest --allure-link-pattern='testcase:https://redmine.xxx.com/issues/25'
============================= test session starts ==============================
platform linux -- Python 3.7.4, pytest-5.1.2, py-1.8.0, pluggy-0.12.0
rootdir: /server/xxx, inifile: pytest.ini, testpaths: features/tests
plugins: allure-pytest-2.8.4
collected 2772 items / 2 deselected / 2770 selected
@maxim-zaitsev
Copy link

@maxim-zaitsev maxim-zaitsev commented Oct 16, 2019

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...

@sseliverstov
Copy link
Member

@sseliverstov sseliverstov commented Oct 16, 2019

@eskignax
Copy link
Author

@eskignax eskignax commented Jun 25, 2020

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 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.