allure-framework / allure-framework/allure-python

Allow users to actually take advantage of passed categories via message regex.

オープン
#790 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
814
フォーク
260
PR マージ指標
30日以内にマージされた PR はありません

説明

[//]: # (
. Note: for support questions, please use Stackoverflow or Gitter**.
. This repository's issues are reserved for feature requests and bug reports.
.
. In case of any problems with Allure Jenkins plugin** please use the following repository
. to create an issue: https://github.com/jenkinsci/allure-plugin/issues
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)

_As a user of the categories.json, I want to be able to display "Passed" categories mapped from the categories.json using the `messageRegex`, so that I can show different "Passed" categories by Name in the UI._

#### I'm submitting a ...
- [ ] bug report
- [x] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.

#### What is the current behavior?

In `pytest_runtest_makereport`, the default value of `status_details` is `None`, and when `test_result.status == Status.PASSED`, it's still None.

As far as I know there's no way to actually provide a message that would enable this to work in a `categories.json`

```json
[
{
"name": "Integration Passed",
"messageRegex": ".*IntegrationTest.*",
"matchedStatuses": ["passed"]
}
]
```

#### If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

A simple bit of code I would expect to work

```python
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
report = (yield).get_result()
if call.when == "call" and report.passed:
report.longrepr = "IntegrationTest Passed"
```

#### What is the expected behavior?

That I can provide a Passed Message to allure to do stuff with the categories.json

```python
status_details = StatusDetails(message=report.longreprtext)
```

#### Please tell us about your environment:

- Allure version: 2.26.0
- Test framework: pytest@7.4.2
- Allure adaptor: allure-pytest@2.13.2

```
platform darwin -- Python 3.11.3, pytest-7.4.2, pluggy-1.3.0
plugins: cov-4.1.0, mock-3.11.1, anyio-3.7.1, xdist-3.3.1, check-2.2.2, allure-pytest-2.13.2
```
#### Other information
None

[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc
)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

allure-pytest アダプターの pytest_runtest_makereport フックから始め、report.longrepr または longreprtext がどのように status_details になるかを追跡します。メッセージが messageRegex に一致する成功したレポートのカバレッジを追加し、categories.json で名前付きの Passed カテゴリを選択できることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing-qa
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。