Test webhooks events
- 主要语言
- Elixir
- 星标
- 33
- 派生
- 3
- PR 合并指标
- 30 天内没有已合并 PR
描述
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
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先阅读所引用的 dwylbot test/controllers/event_controller_test.exs,并在此 repository 中跟踪 webhook endpoints 到其 controllers。调查 GitHub 是否提供 sandbox 或其他真实 webhook 数据来源,并将其与当前基于 fixture 的方法进行比较。当形成一套经认可且可维护的测试策略,能够使用足够新的数据检查 webhook controller 逻辑时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- elixir, github
- 领域
- backend, testing
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100