Steps throwing exceptions not reported as an error (Boost.Test)
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
- 45/100
Hướng nghiên cứu
Tìm lời gọi runWithMasterSuite() của BoostDriver và xem xét unit_test_monitor.ipp, nơi các ngoại lệ được bắt và báo cáo cho các observer. Kiểm tra cách driver xác định một step thành công và so sánh với đầu ra của Boost.Test results_collector. Được coi là hoàn tất khi một step ném ngoại lệ được báo cáo là thất bại thay vì thành công, với các chi tiết lỗi được cung cấp cho cucumber-cpp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
We encountered the issue that step definitions which throw an exception are reported as passed, when using the Boost.Test framework and cucumber-cpp.
Expected Behavior
Our expectation was that a step which throws an exception (for whatever reason) should be reported as a failed step by cucumber-cpp.
Current Behavior
The step is reported as passed. The rest of the step definition after the exception gets thrown, doesn't get executed.
Possible Solution
Not familiar with Boost.Test nor cucumber-cpp source code, but while debugging this, I noticed the following:
The exception is caught by unit_test_monitor_t::execute_and_translate(...) in unit_test_monitor.ipp and gets reported to test observers.
However, the BoostDriver only considers the test log for the decision to rate a step as success or failure, but exceptions don't show up in this log for some reason.
We could successfully trigger a failed step by adding something along the following lines after runWithMasterSuite() (needs #include <boost/test/results_collector.hpp>):
auto results = ::boost::unit_test::results_collector.results(testCase->p_id);
if (!results.passed())
{
std::string description = "Test aborted/failed with result code " + std::to_string(results.result_code());
return InvokeResult::failure(description.c_str());
}
- Ngôn ngữ chính
- C++
- Star
- 330
- Fork
- 142
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- 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 cucumber/cucumber-cpp
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
cucumber/cucumber-cpp#317 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
cucumber/cucumber-cpp#313 · 9 bình luận ·
-
Authorize hyphen "-" for TagCó thể làm lại được @ursfassler đã nhận 399 ngày trước và không có pull request nào đang mở. Đang mởbug
cucumber/cucumber-cpp#312 · 4 bình luận · 1 người được giao ·
-
feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
cucumber/cucumber-cpp#304 · 2 bình luận ·
-
Cucumber for MakefileĐang mởhelp
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
cucumber/cucumber-cpp#302 · 1 bình luận ·
Tất cả issue của cucumber/cucumber-cpp
Issue tương tự
-
Build fails on macOS 27: dyld refuses stripped Rust proc-macros (mis-aligned LINKEDIT string pool)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
cloudflare/workerd#8963 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Core Drape
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
organicmaps/organicmaps#14449 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-codecs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ClickHouse/ClickHouse#135159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[raygui] update to 5.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 2 ngày
-
difficulty:easy func:python os:windows prio:high type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NatronGitHub/Natron#2029 ·
Maintainer thường phản hồi trong vòng 1 ngày