AssertionError message to nagios output
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with the pytest command using the --nagios option and compare its output with the same command without --nagios, using the shown AssertionError case. Trace how the assertion message is handled for the Nagios result and verify that the failing test's message appears in the final Nagios output while the pass/fail summary remains intact.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello I have a simple test where I print the filename if the file exists.
/home/nagios/monitoring-env/bin/pytest -v -s -qq --nagios --tb long --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
input file: test.txt
File Found: '/usr/local/ncpa/plugins/test.txt'
TESTINFRA OK - 1 passed, 0 failed, 0 skipped in 0.06 seconds
In nagios I do see the print statement: File Found: '/usr/local/ncpa/plugins/test.txt'
I have a simple assert in my code;
assert len(list_match)==1 , " File NOT Found:" + str(list_match).strip('[]')
If i run the test without nagios I do see the AssertionError
/home/nagios/monitoring-env/bin/pytest -v -s --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
E AssertionError: File NOT Found: '/usr/local/ncpa/plugins/test.txt'
TESTINFRA CRITICAL - 0 passed, 1 failed, 0 skipped in 0.10 seconds
How can I have the AssertionError message displayed in Nagios when running the command below?
/home/nagios/monitoring-env/bin/pytest -v -s -qq --nagios --tb long --inputfile=test.txt /usr/local/ncpa/plugins/test_myinfra.py
TESTINFRA CRITICAL - 0 passed, 1 failed, 0 skipped in 0.06 seconds
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 358
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytest-dev/pytest-testinfra
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 58/100
pytest-dev/pytest-testinfra#815 ·
-
service is_enabled does not work with exit code 4Có thể đã có người làm @pfuntner đã nhận 581 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
pytest-dev/pytest-testinfra#801 · 1 bình luận ·
-
Chroot backendĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
pytest-dev/pytest-testinfra#789 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
pytest-dev/pytest-testinfra#788 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
pytest-dev/pytest-testinfra#786 ·
Tất cả issue của pytest-dev/pytest-testinfra
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
jejjohnson/gaussx#752 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4270 ·
-
enhancement owner: den-haag
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
ok-oldking/ok-wuthering-waves#1828 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
lesson-submission pending-review
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Ikalus1988/MisakaNet#4512 ·
Maintainer thường phản hồi trong vòng 1 ngày