allure-framework / allure-framework/allure-python

Test Case is missing in report when It failed because of pytest worker crash

Đang mở
#825 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug theme:pytest
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ả

[//]: # (
. 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
)

#### I'm submitting a ...
- [✓] 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?
In my Jenkins CI, we run Selenium automation using pytest with a Selenium Grid. Sometimes, the pytest worker crashes, causing the test case to fail with the status “FAILED”. When a test case fails due to a pytest worker crash, the failed test case is missing from the report

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

**Python Code to reproduce the Issue:**

import os

def test_simulate_crash():
if os.environ.get("PYTEST_XDIST_WORKER", None):
os._exit(1) # This will crash the worker process
assert True

def test_normal():
assert True

![pytest-worker-crash-console-logs](https://github.com/user-attachments/assets/c60ba7e8-d300-49d5-8516-e48919c08a36)
![pytest-worker-crash-allure-report](https://github.com/user-attachments/assets/731d4cc1-7ec2-4756-9c24-fef9e0020a0f)
![pytest-worker-crash-html-report](https://github.com/user-attachments/assets/60043857-4d42-4e96-a623-0e6b2ae483ef)

#### What is the expected behaviour?

The Failed Test Case ('test_simulate_crash' in the above code) should be shown in the allure report.

For reference, I attached the HTML report where we could see the Failed Test Cases.

#### What is the motivation / use case for changing the behavior?

#### Please tell us about your environment:

- Allure version: 2.29.0
- Test framework: Python 3.9.6
- Allure adaptor: allure-pytest-2.8.40

#### Other information
Related ticket for pytest worker crash
https://github.com/pytest-dev/pytest-xdist/issues/466

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng việc tái hiện trong Python sử dụng pytest và trường hợp test_simulate_crash, sau đó so sánh đầu ra của nó với các báo cáo Allure và HTML đính kèm. Sử dụng issue liên quan về worker-crash của pytest-xdist làm ngữ cảnh; được coi là hoàn tất khi trường hợp kiểm thử thất bại xuất hiện trong báo cáo Allure sau worker-crash.

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.