allure-framework / allure-framework/allure-python

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

Open
#433 5 comments 0 reactions 0 assignees View on GitHub
task:new feature theme:pytest
Dominant language
Python
Stars
814
Forks
260
PR merge metrics
No merged PRs in 30d

Description

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

```python
import allure

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

def test_without_allure_link():
pass
```

```bash
(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

```bash
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
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior with the provided test_allure_link.py example and the pytest command using --allure-link-pattern. Start by tracing how allure-pytest registers the option and applies collection filtering; done means the linked test is selected while the unlinked test is deselected, with coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.