allure-framework / allure-framework/allure-python
Excluding allure-labels in pytest run
- 主要语言
- Python
- 星标
- 815
- 派生
- 260
- PR 合并指标
- 30 天内没有已合并 PR
描述
#### I'm submitting a ...
- [ ] feature request
#### What is the current behavior?
We have CLI param `--allure-label` and its possible to INCLUDE labels. Like `--allure-label method=AnyMethod` and it works
#### If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
But I decided to try to exclude from run tests with `@allure.manual(True)` decorator and came across a bunch of things:
1. You can't even include by label if your value (but it's default value) is a bool type. Example: if you set `--allure-label ALLURE_MANUAL=True` in CLI so it will deselect everything.
2. But I could find an interesting moment: if to write decorator like `@allure.manual('True')` and set the same `--allure-label ALLURE_MANUAL=True` in CLI -- it works and manual tests will be selected.
#### What is the expected behavior?
I want not just include labels, but also exclude. Something like `--allure-label "not ALLURE_MANUAL=True"`
#### What is the motivation / use case for changing the behavior?
We write tests as code and we dont need manual test cases in allure report. With this feature we will be able to run night tests and they will be closed automatically in allure testOps.
#### Please tell us about your environment:
- Allure version: 4.22.1
- Test framework: pytest==7.2.2
- Allure adaptor: allure-pytest==2.13.2
贡献指南
调研方向
首先跟踪 pytest 适配器如何解析 CLI 参数 --allure-label,并将其与 allure.manual 装饰器中的值进行比较。检查现有的包含行为,并确定应如何表示类似 "not ALLURE_MANUAL=True" 的排除表达式。当布尔值 label 能够一致地工作,并且匹配的 label 可以从运行中排除时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- cli, testing
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100