2 ms·
Testing is one of the areas that we have felt the most in Elixir while building Batteries Included. ExUnit is pretty good, but bare bones. That combined with Ph
by eclark 3y ago
Testing is one of the areas that we have felt the most in Elixir while building Batteries Included. ExUnit is pretty good, but bare bones. That combined with Phoenix (most popular web framework in elixir) made for some places we didn't test. So we created a test library that does polaroid snapshot testing of Phoenix components. We called it Heyya and added other utilities to test phoenix live view too.
Does anyone have solutions for Ecto testing with processes?
- https://www.batteriesincl.com/ https://www.batteriesincl.com/
- https://github.com/batteries-included/heyya https://github.com/batteries-included/heyya
- https://hex.pm/packages/heyya https://hex.pm/packages/heyya
- cpursley 3y agoWhat do you mean testing with processes? I won't suggest these are the best written tests, but I test various processes, supervisors, etc like this: - https://github.com/cpursley/walex/blob/master/test/walex/supervisor_test.exs#L20 https://github.com/cpursley/walex/blob/master/test/walex/sup... - https://github.com/cpursley/walex/blob/e13a9cbf9aca1a2a2d4ed0ec1841d00072990ac4/test/walex/database_test.exs#L45 https://github.com/cpursley/walex/blob/e13a9cbf9aca1a2a2d4ed...
- eclark 3y agoIf have an `Application` that starts processes that cache ecto state, or periodically write to db, etc, it's hard to test the whole process tree. Additionally Umbrella projects start all applications in the project with one config. All of those combined mean you have to change your code structure quite a lot to make that testing possible. Testing single processes is pretty easy. Making sure that two processes and ecto can tolerate failures, delays, etc requires too much.