allure-framework / allure-framework/allure-python

Resolving 'fullName' Field Issue in Allure-Pytest: A Local Solution and Call for Official Adjustment

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

説明

Hello, currently I am using Allure TestOps to manage my automated tests, and after much searching, I finally found a small issue that was not noticeable before in allure-pytest. The problem is that when I run tests with examples using (@pytest.mark.parametrize) with more than one test, at the end of the execution, the result.json file is filled with the "fullName" field containing only the test name without the examples appended. In other words, when I add the execution results to TestOps, it considers it as a single test instead of the multiple tests I have in the parametrize. Here's an example below:

![image](https://github.com/allure-framework/allure-python/assets/58951154/10e65dca-6f50-48ef-8b2c-51aaf4d2ded6)

After cloning the allure-python repository, I was able to identify that in the utils.py file of allure-pytest, on line 122, the method "allure_full_name" is located. What I did to test it locally was to modify the line that previously read:

test = item.originalname if isinstance(item, pytest.Function) else item.name.split("[")[0]

to:
test = item.name

After reinstalling the library locally, the issue was resolved as evidenced below:

![image](https://github.com/allure-framework/allure-python/assets/58951154/c271343c-eb72-4753-8d0f-0b50ae68b917)

I didn't encounter any functionality issues with allure-pytest after making this local modification. Can you make this adjustment officially in the library?

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

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

調査の方向性

allure-pytest/utils.py の 122 行目付近にある allure_full_name メソッドから始め、複数の例を持つ pytest.mark.parametrize テストで問題を再現します。生成された result.json を調べ、各パラメーター化された結果に個別の fullName があることを確認して、TestOps がテストを個別に認識できるようにします。

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

評価

技術スタック
python
領域
testing
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

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

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