allure-framework / allure-framework/allure-python
Resolving 'fullName' Field Issue in Allure-Pytest: A Local Solution and Call for Official Adjustment
- Ngôn ngữ chính
- Python
- Star
- 814
- Fork
- 260
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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:

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:

I didn't encounter any functionality issues with allure-pytest after making this local modification. Can you make this adjustment officially in the library?
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu trong allure-pytest/utils.py, tại phương thức allure_full_name quanh dòng 122, và tái hiện vấn đề bằng một kiểm thử pytest.mark.parametrize có nhiều ví dụ. Kiểm tra result.json được tạo ra và xác minh rằng mỗi kết quả được tham số hóa có một fullName riêng biệt để TestOps nhận diện các kiểm thử riêng biệt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- testing
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 55/100