dwyl / dwyl/github-backup

Test webhooks events

Đang mở
#26 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
help wanted technical
Ngôn ngữ chính
Elixir
Star
33
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

One way to test the logic of the app when a webhook request is received is to mock the request. The tests will send a "fake" payload on the endpoints of the app and from this can check that the logic of the controllers linked to the endpoint is correct. It is the way that we are currently using on dwylbot:

https://github.com/dwyl/dwylbot/blob/master/test/controllers/event_controller_test.exs

I'm wondering if we could find another way to test the application without using mock? I would prefer to use "real" data from Github and not based our test on fixtures which might not be updated for a long time (the Github API might change but not the fixtures)

see:
- http://blog.plataformatec.com.br/2015/10/mocks-and-explicit-contracts/
- https://stackoverflow.com/questions/16992777/is-there-a-sandbox-version-of-the-github-api-v3-for-testing-apps

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 đọc dwylbot test/controllers/event_controller_test.exs được tham chiếu và lần theo các webhook endpoint đến các controller tương ứng trong repository này. Điều tra xem GitHub có cung cấp sandbox hoặc nguồn khác chứa dữ liệu webhook thực tế hay không, và so sánh với cách tiếp cận hiện tại dựa trên fixture. Được xem là hoàn thành khi có một chiến lược kiểm thử có thể duy trì, đã được thống nhất, để kiểm tra logic của webhook controller dựa trên dữ liệu đủ mới.

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

Đánh giá

Công nghệ
elixir, github
Lĩnh vực
backend, testing
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/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.