caolan / caolan/nodeunit

Undone tests fail silently when using the JUnit reporter

Đang mở
#157 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
1.9k
Fork
359
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

When running unit tests at the command line, using the default reporter, I get the following error in the console if there are undone tests:

_FAILURES: Undone tests (or their setups/teardowns):
details of my test here
To fix this, make sure all tests call test.done()_

However, when using the JUnit reporter, the failure is completely silent - no XML files are written. In our case, this means that our CI system (Jenkins) doesn't see the failures (or indeed any results) and hence marks the build as a success.

I would expect the results to still be written in this case, so that we can see which tests have passed and which have failed.

Note that the cause of undone tests isn't always due to the developer failing to call test.done() - in this specific case, the test.done() was in a callback within the unit test that ended up not getting called due to regression introduced in the production code being tested.

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách lần theo cách reporter JUnit xử lý các test chưa hoàn tất và so sánh với đường dẫn lỗi của reporter mặc định. Tái hiện vấn đề bằng một test chưa hoàn tất, sau đó xác minh rằng reporter ghi XML chứa các kết quả đạt và không đạt có liên quan thay vì im lặng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
testing-qa
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
42/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.