gleam-lang / httpc

📡 Make requests to HTTP servers with httpc
https://hexdocs.pm/gleam_httpc/
Apache License 2.0
80 stars 14 forks source link

Add tests #5

Open CrowdHailer opened 4 years ago

CrowdHailer commented 4 years ago

At the moment the tests are probably quite thorough because the hit a real API endpoint. However this means they are somewhat fragile.

Also all the functions are marked as TODO: test @lpil do you have an idea on how you would like to test these functions?

In magpie I ran tests against a locally running version of httpbin.org however that did add a dependence on docker, which I'm unsure if you want to add as a requirement for contributing. I also haven't played much with github workflows so am unsure what that would take

https://github.com/midas-framework/magpie/blob/master/test/magpie_test.gleam#L12 https://github.com/midas-framework/magpie/blob/master/docker-compose.yml#L24-L27

lpil commented 4 years ago

Those endpoints are intended for public use and are quite reliable. I do not want to add a docker compose dep as it's not an open standard and only works with that specific tool. I'm open to containers as they're less niche and supported by many clients, though I would prefer to have no requirement for additional software being installed (i.e. use existing services, Gleam, or Erlang)

CrowdHailer commented 4 years ago

If your happy with those endpoints, which sounds perfectly sensible. I think some of the todo Test could be removed?

lpil commented 4 years ago

Probably! I added them while working to suggest that more tests could be done, but I didn't get to a point where I felt it would add value to do so.

On Tue, 11 Aug 2020, 13:51 Peter Saxton, notifications@github.com wrote:

If your happy with those endpoints, which sounds perfectly sensible. I think some of the todo Test could be removed?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gleam-lang/httpc/issues/5#issuecomment-671927804, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOZVBXEW7DKHM473GLRX53SAE5FXANCNFSM4PXM3GAQ .