ehance testability of clients
@gresrun đang làm issue này rồi.
Từ ngày 26/3/2016.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
cool library with some interesting ideas.
Ideally, I was trying to create a simple wrapper to hide jesque(and simulate jesque) from a testability perspective. Unfortunately, the design seems to be preventing that or I am missing a method I could use? Perhaps you might know?
I was trying to create a singleton like so
public class ResqueWrapper {
public void addQueueListener(ResqueListener l, Collection<String> queueNames) {
//VERY VERY little code that I can only test in staging
}
public void remoteQueueListener(ResqueListener l) {
}
}
As I got into implementing this, I found out jesque is doing some reflection stuff that I would like to avoid especialy since it is on my business logic and I prefer to have all business logic stateless and created via guice. I really just want jesque to call
resqueListener.processItemsInQueue(String fromQueue, Items items)
resqueListener.failed(fromQueue, Throwable t)
where Items has an ack or nack. Then I can fully simulate my system. Unfortunately, jesque is making it really hard to wrap my system in a 'large' system type test where I swap out guice remote endpoints(so it's all single threaded and doesn't talk remotely at all during the test). This enables us to test talking to S3 failures after getting a resque item and make sure the system does what it is supposed to on an S3 failure or an mysql failure, etc. etc.
Is there any way to do this?
For one thing, the reflection to create a job class is what is hurting me. Reflection to create a data object to pass into a generic resque listener would have been ok like ResqueListener
Ideally, the api should only be passing data rather than fiddling with my business logic such that my test can easily do the same. It just creates a situation in which the test can simulate 99% of the code rather than 70% of the code which is what we have right now.
It's hard to explain this concept, but basically our tests on other projects do this
- feed in data through to the listener(test has a reference to the listener as it mocks the ResqueWrapper to be able to grab the listeners that were added)
- from there it is 100% production code until the remote endpoint
- at the remote endpoint, our test throws an exception
- then we verify a call to mysql results in recording that exception as well(which again is a mocked endpoint).
thanks,
Dean
- Ngôn ngữ chính
- Java
- Star
- 629
- Fork
- 133
- 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
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 gresrun/jesque
-
Pooled clients leak a connection per call: pipelines and transactions taken from UnifiedJedis are never closedCó thể đã có người làm @ali-jawad đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
-
Latest jedis SDK support?Có thể làm lại được @gresrun đã nhận 297 ngày trước và không có pull request nào đang mở. Đang mởDiscussion
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Redis Cluster IssueĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của gresrun/jesque
Issue tương tự
-
[BUG] jackson3 JacksonJsonpMapper(ObjectMapper) fails to deserialize `_source` with "Trailing token" errorCó thể đã có người làm @junyeokk đã nhận hôm nay. Đang mởbug untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
opensearch-project/opensearch-java#2236 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
open-learning-exchange/myplanet#18392 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
linagora/twake-calendar-side-service#1218 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusCó thể đã có người làm @leizhiyuan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/rocketmq-clients#1465 ·
Maintainer thường phản hồi trong vòng 2 ngày